0 votes
asked in General Help by (120 points)

I am using UserControlThirdPerson.cs as a base because I like how the player movement is very fluid but I want to be able to use a floating joystick I have set up with Joystick Pack from Asset Store.

This is a script I have from another game of mine which moves around a sphere collider direction you are facing works fine.

public class JoystickPlayerExample2 : MonoBehaviour


    public Rigidbody myBody;

    public static float moveForce = 10f;

    public VariableJoystick joystick;

    public CharacterMovementScript charScript;

    private bool useAnimOnce;

    private void Start()


        moveForce = 4;


    private void Update()


        myBody.velocity = new Vector3(joystick.Horizontal * moveForce, myBody.velocity.y, joystick.Vertical * moveForce);

        if(joystick.Horizontal != 0f || joystick.Vertical != 0f)


            if(myBody.velocity != new Vector3(0,0,0))

                transform.rotation = Quaternion.LookRotation(-myBody.velocity);

            if (!useAnimOnce)



                useAnimOnce = true;


        } else


            if (useAnimOnce)



                useAnimOnce = false;





I am trying to implement the animation stuff and also have similar movement. Was wondering if I could get any hints/tips on how I can achieve this?

1 Answer

0 votes
answered by (22.8k points)


Haven't tried it myself, but can't you just replace:

float h = Input.GetAxisRaw("Horizontal");

float v = Input.GetAxisRaw("Vertical");

with joystick.Horizontal and joystick.Vertical?



Welcome to RootMotion Q&A, where you can ask questions and receive answers from the developer of Final IK and PuppetMaster and other members of the community.

Post as a guest, create an account or login via Facebook.

Please use the correct category when you post your questions.