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);
useAnimOnce = true;
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?