Hi! i am completely new in unity and i’m currently working on a simple platform type game. I’ve come to the part where I made a gameobject (a small platform) in which the character can stand on and I want it to move forwards and backwards. how do i do that. Thank you in advance.
You want to move the platform? You want to move back and forth the easiest way is to use a cos function I think
transform.position.x += A*Mathf.Cos(omega*Time.time);
A is the amplitude/travel distance, omega is the “frequency” or speed
Then it goes back and forth with a little slow down effect at the edge.
Try and see if that works.