- Home /
Moving an object up and down
Hey everyone I have got a serious problem. Im trying to make a platform move up and down in c#. I tried to use all sort of stupid stuff but none have worked can anyone please help me with this! Thanks!
Duplicate question: http://answers.unity3d.com/questions/358716/moving-a-object-up-and-down.html
(-1)
Answer by CodeMasterMike · Dec 04, 2012 at 10:36 AM
Use the function Translate to move your platform object up and down, like in this pseudo code:
// move platform up
PlatformObject.Transform.Translate(new Vector3(0.0f, 1.0f, 0.0f), Space.World);
//move platform down
PlatformObject.Transform.Translate(new Vector3(0.0f, -1.0f, 0.0f), Space.World);
You can read about it in the Translate documentation
Good luck!
Answer by MarkFinn · Dec 04, 2012 at 10:34 AM
See this previous Question and answer.
http://answers.unity3d.com/questions/8207/charactercontroller-falls-through-or-slips-off-mov.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613084933im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Moving a object up and down 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Combine transform.forward and transform.up? 4 Answers
Realistic walking. 1 Answer