**Help me to create jumping script for button. I’m making android inputs, so I need jump button!
I found some codes, but it doesn’t work.
Thank you in advance!
**
When the Jump button is triggered try adding some force in y direction to your player.This code should help. Customize it according to your needs.
public float force;
public Rigidbody player;
void Start()
{
player= GetComponent<Rigidbody>();
}
void FixedUpdate()
{
if (CrossPlatformInputManager.GetButton ("Jump"))
{
player.AddForce(transform.up * force);
}
}