- Home /
Question by
llmm · Jun 16, 2020 at 02:55 AM ·
cameramovementrotate object
how to make sure cube doesn't "climb" up wall ?
was wondering how do i make sure it doesnt "climb " up the wall
i followed the tutorial https://www.youtube.com/watch?v=LACgclt-aCM
my cube keep climbing up the wall i dont quite understand
Comment
Best Answer
Answer by Sidd_Code · Jun 16, 2020 at 06:31 AM
Add this code to your to your cube! And assign the same cube to the script!
Write this lines code inside your update function...
public Game Object cube;
void Update ()
{
if (cube.transform.position.y >= 1)
{
cube.transform.Translate.position -= new Vector3 (0, 1, 0);
}
}
That's it @llmm !
Your answer
Follow this Question
Related Questions
UNITY 3D: How to make the camera follow the player? Smoothly 2 Answers
Mouse movement object in a straight line 2 Answers
Move relative to screen 0 Answers
How do I add a camera bounce effect every time the player lands? 0 Answers
Camera movement help 1 Answer