I am trying to add force to the player's rigidbody, when the screen is held. I've written the following code:
float PlayerForce=50.0f;
void FixedUpdate()
{
bool PlayerActive = Input.GetButton ("Fire1");
if (PlayerActive) {
PlayerRigidBody.AddForce (new Vector2 (0, PlayerForce));
}
}
This does not add a smooth jump effect. I've searched for smooth force effect, but I didn't find anything useful. How do I add a smooth force my player's rigid body, to make them jump?