I am making a 2d platformer and I want to make a moving platform. However, I can’t use AddForce() to move it because if I attach a rigidbody to it it falls down due to gravity. I then tried Vector2.MoveTowards. But, that didn’t work either. So what’s the best way to move a game object in unity.
Try AddForce() and uncheck the gravity checkbox on the rigidbody.
You could turn off gravity for this RigidBody.
But I would prefer using transform.Translate().
Ask if something is unclear.