playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Franck

Pages: [1]
1
Playmaker Help / Trying to make a game like The Fortune Wheel
« on: November 04, 2018, 08:59:24 AM »
Hello everyone,

I'm trying to prototype a new game like the Fortune Wheel.
Currently I can spin the wheel physically and it stops with the friction. The wheel as a rigidbody and don't use the gravity and is not kinematic.
To find out where the arrow stops, I throw a raycast from the bottom of this arrow. This raycast records a hitobject placed on the wheel.
I am now looking for ideas especially for how to know when the wheel is stopped to know the good hitobject with the raycast (because the raycast records the hitobject as the wheel rotates)?

And after when the hitobject is found I want to show the gain.

I think I must ensure that the wheel stops completely when it is between two studs but I do not know how to go there.


2
Playmaker Help / Camera lock vertical look when rotate animation
« on: October 19, 2018, 12:44:26 PM »
Hi there,

I have a camera problem when I do an animation. I use the SimpleSmoothMouseLook script which works very well but as soon as I want to make a camera animation by giving it a rotation, when I run the game I can not look up and down anymore.
The problem comes from the rotation animation of the camera but I do not know how to adjust it.

An idea?

Here is the script:

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[AddComponentMenu("Camera/Simple Smooth Mouse Look ")]
public class SimpleSmoothMouseLook : MonoBehaviour
{
    Vector2 _mouseAbsolute;
    Vector2 _smoothMouse;

    public Vector2 clampInDegrees = new Vector2(360, 180);
    public bool lockCursor;
    public Vector2 sensitivity = new Vector2(2, 2);
    public Vector2 smoothing = new Vector2(3, 3);
    public Vector2 targetDirection;
    public Vector2 targetCharacterDirection;

   
    // Assign this if there's a parent object controlling motion, such as a Character Controller.
    // Yaw rotation will affect this object instead of the camera if set.
    public GameObject characterBody;

    void Start()
    {
        // Set target direction to the camera's initial orientation.
        targetDirection = transform.localRotation.eulerAngles;

        // Set target direction for the character body to its inital state.
        if (characterBody)
            targetCharacterDirection = characterBody.transform.localRotation.eulerAngles;
    }

    void Update()
    {
        // Ensure the cursor is always locked when set
        if (lockCursor)
        {
            Cursor.lockState = CursorLockMode.Locked;
        }

        // Allow the script to clamp based on a desired target value.
        var targetOrientation = Quaternion.Euler(targetDirection);
        var targetCharacterOrientation = Quaternion.Euler(targetCharacterDirection);

        // Get raw mouse input for a cleaner reading on more sensitive mice.
        var mouseDelta = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y"));

        // Scale input against the sensitivity setting and multiply that against the smoothing value.
        mouseDelta = Vector2.Scale(mouseDelta, new Vector2(sensitivity.x * smoothing.x, sensitivity.y * smoothing.y));

        // Interpolate mouse movement over time to apply smoothing delta.
        _smoothMouse.x = Mathf.Lerp(_smoothMouse.x, mouseDelta.x, 1f / smoothing.x);
        _smoothMouse.y = Mathf.Lerp(_smoothMouse.y, mouseDelta.y, 1f / smoothing.y);

        // Find the absolute mouse movement value from point zero.
        _mouseAbsolute += _smoothMouse;

        // Clamp and apply the local x value first, so as not to be affected by world transforms.
        if (clampInDegrees.x < 360)
            _mouseAbsolute.x = Mathf.Clamp(_mouseAbsolute.x, -clampInDegrees.x * 0.5f, clampInDegrees.x * 0.5f);

        // Then clamp and apply the global y value.
        if (clampInDegrees.y < 360)
            _mouseAbsolute.y = Mathf.Clamp(_mouseAbsolute.y, -clampInDegrees.y * 0.5f, clampInDegrees.y * 0.5f);

        transform.localRotation = Quaternion.AngleAxis(-_mouseAbsolute.y, targetOrientation * Vector3.right) * targetOrientation;

        // If there's a character body that acts as a parent to the camera
        if (characterBody)
        {
            var yRotation = Quaternion.AngleAxis(_mouseAbsolute.x, Vector3.up);
            characterBody.transform.localRotation = yRotation * targetCharacterOrientation;
        }
        else
        {
            var yRotation = Quaternion.AngleAxis(_mouseAbsolute.x, transform.InverseTransformDirection(Vector3.up));
            transform.localRotation *= yRotation;
        }

        // Hide cursor
        Cursor.visible = false;
    }
}

3
Playmaker Help / Game ok in Game tab but Not in Build[SOLVED]
« on: October 19, 2018, 07:53:27 AM »
Hi there,

I tried to make a build for my test project but I realize that the game works well in Game Mode but not in Build.
What does not work is damage to NPCs and they do not take damage.

Here's a video that shows how the game behaves in Game Mode and Build Mode.


Thank you in advance.

4
Playmaker Help / How to kill prefab enemy?
« on: October 10, 2018, 10:49:03 AM »
Hello everyone,

in my FPS I do a raycast to hit the NPCs. When the Prefab is in the scene everything is working properly. My raycast hits the target with a collider trigger and deal damage.
On the other hand, when I remove the prefab from the scene and instantiate it at start it's a clone that's created and my raycast does not work on it anymore, so I can not kill it.

5
Playmaker Help / Problem with animation stop
« on: October 03, 2018, 03:33:08 AM »
Hi there,

I have a problem when I stop an animation in progress.
For example, I have an empty gun, when I aim everything is OK, but when I want to reload it and I stop the animation in progress by changing weapon and I come back on it, the position of my gun is not like in the beginning. It kept the position when the animation was stopped.

Here is a video that shows the problem.
Thank you in advance for your help.


6
Playmaker Help / Problem with raycast normal
« on: September 21, 2018, 10:39:54 AM »
Hello everyone,

I'm trying to create a bullet hole with a raycast hit.

I have a state in which the "raycast" action that creates the raycast and stores the informations.

In the following state I have a "create object" action that contains my "bullet hole" object and gets the position of hit raycast ("hit point") and rotation ("hit normal").

But when I pull the raycast my bullet holes are positioned correctly on vertical walls but not on floors.

The bullet holes still remains positioned vertically.

Have I forgotten something?

7
Playmaker Help / Weapon Spread, how to?
« on: September 14, 2018, 12:26:16 PM »
Hi folks,

I'm ready to finish my FPS character. All I have to do is find a way to make the weapons less accurate.
I use the raycasts for aiming and I would like that when my character shot it is less and less accurate.
Do you have any idea how I can do it?
I thought about moving the main camera while shooting but there is no result.

8
Playmaker Help / Loop count exceeded maximum...[SOLVED]
« on: September 09, 2018, 03:31:06 AM »
Hi there,

I try to make that when my character runs it throws a gun animation that comes against the body.
Unfortunately, I have an error in the console and the game mode stops because of a loop count.
Here are some screens of my FSM. I guess the loop is when I get to the float compare because of the checkbox "every frame". When I uncheck it I have no more error but the animation does not start. What's strange is that it does not do that to me all the time. Sometimes I get the animation, but the next time the mistake happens ...
And for info, I have a speed script to get the speed of my character:

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Speed : MonoBehaviour {

    public float speed = 0;

    Vector3 lastPosition = Vector3.zero;

   

// Update is called once per frame
void FixedUpdate () {

        speed = (((transform.position - lastPosition).magnitude) / Time.deltaTime);
        lastPosition = transform.position;

    }
}



9
Playmaker Help / How to raycast hit for an automatic gun?[SOLVED]
« on: September 06, 2018, 08:46:03 AM »
Hi there,

I'm trying to do an Automatic Gun with raycast hit.

For the moment I can shoot a raycast and know if it hit something. And if that's the case I do an addexplosion to see the enemy flying.

What I can not do is an automatic weapon. I can only send one raycast after another by pressing successively on the fire button of the mouse. I wish that when I press and hold the button down, raycasts are automatic, with a small delay obviously.

10
Playmaker Help / The player goes to the ground when crouching[SOLVED]
« on: September 06, 2018, 05:22:31 AM »
Hello everyone,

I have been trying for several days to crouch my character without success.
When he crouches and gets up he stays stuck in the ground with his collider. I have not found anything on the internet that can explain how to solve this problem with Playmaker.
Do you have an idea?

Thank you in advance.

11
Playmaker Help / Create an action when the Character is runing[SOLVED]
« on: September 04, 2018, 08:21:58 AM »
Hello everyone,

I'm slowly learning Unity and Playmaker. Having no experience in development I admit to drool a little :)
I ordered a course on Udemy that allowed me to begin but it is obviously not enough.
So I installed playmaker to help me in programming without having to code.

Currently I test a little the possibilities (well mine instead). So I created a floor and put my FPS CONTROLLER with standard assets. My character can move around the world. I added arms and a weapon. This weapon can shoot and know if it made a hit thanks to Raycast. I can also right click and reach the aimed shouldered (thanks to animations).

Now what I want to do but can not do it is that the Character runs but can not shoot before resuming or being stopped.
I managed to make an FSM on the weapon by saying that if I press the LEFT SHIFT button my animation starts (animation that brings the weapon close to the body) and that the SHOOT and AIM FSM are disabled. Thanks to that, when I press LEFT SHIFT I can not aim and / or shoot anymore.
The big problem with this method is that even if I don't move and press LEFT SHIFT, my weapon goes as if I was going to run and inevitably prevents me from shooting and / or aiming.
What I want to do is make an FSM that makes it happen at a certain speed (according to the script FPS CONTROLLER I think?) My weapon plays the animation that sticks on the body and I can not no longer shoot and / or aim.

I hope I was pretty clear in my explanation, it's not necessarily obvious to make things clear to others when already in his own head it's confused lol

And sorry for my english, I'm French.

In any case, thank you in advance to those who will take the time to help me.

Pages: [1]