- Home /
Moving A cube(object) up(make it rise)
I am making a game that you have to escape the "fog" (At the moment it is just a big cube) and you must go up while the "fog" rises. How would I go about making this"fog"(Cube) rise up slowly? please be specific as in what to do :)
thanks but I am not that new to unity. I have created a game already, just a brain cramp
Answer by moghes · Dec 13, 2012 at 01:47 PM
function Update ()
{
this.transform.Translate(Vector3(0,1,0));
}
attach this script to your gameObject. You can change the value for changing the speed of rising .
Be sure to remove the gravity tick from the checkbox, if it has a rigidbody component. For example if you have this.transform.Translate(Vector3(0,0.1,0)); the cube will not rise up, since the gravity force is pulling down at a faster rate.
If that worked perfectly, you simply have to tick the answer as true!
Your answer
Follow this Question
Related Questions
moving a cube 2 Answers
How to move several objects "y" units during a fixed time 1 Answer
How to find cube face, to move it in that face direction 0 Answers
Cube Rotating & Moving 1 Answer
Moving and rolling a cube 1 Answer