// Normal Movements Variables
public float Speed;
void FixedUpdate()
{
// Move senteces
GetComponent().velocity = new Vector2(Mathf.Lerp(0, Input.GetAxis("Horizontal")* Speed, 0.8f),
Mathf.Lerp(0, Input.GetAxis("Vertical")* Speed, 0.8f));
}
}
Now this works great on my keyboard for what I need.....However....I'm trying to port my game to mobile and it's not working. No matter what kind of UI controls I give, it wont work. I figured the crossplatforminput would work, but it doesn't. I'm using the Joystick.cs file that comes with unity.
↧