I'm making a game with Unity where player pick up a cookie and then player is jumping on y-axis. When player is jumping, he is twitching(very much). I want that jump and I want see that player is jumping smoothly. This is my sample of code
void OnTriggerEnter2D(Collider2D other)
{ if(other.gameObject.CompareTag("Player")) { player.velocity = new Vector2 (0, 0); player.AddForce(new Vector2(0,jumpHeight));
}
I tested about 1000f value of jumpHeight. Same problem is with higer or lower value.
Thanks and kind regards