- Home /
Question by
dsillman2000 · Feb 23, 2014 at 01:02 AM ·
gameobjectphysicsaxisy axis
How to code anywhere below -10?
Currently, I want to code my game so that when my player's position on the y-axis drops below -10, he is set to be inactive. My current idea is that it would look something like this:
if(gameObject.yaxis < -10)
{
gameObject.SetActive(false);
}
However, I am unsure of how to do this because I am relatively certain yaxis is not a property of gameObject.
Help please?
Comment
Best Answer
Answer by Bunnybomb7670 · Feb 23, 2014 at 01:04 AM
gameObject.transform.position.y < -10. The Transform class holds all the position and rotation information of an object.
Your answer
Follow this Question
Related Questions
Orbit Collision Axis 0 Answers
C#: Move an object along one axis at time 3 Answers
How do i make a cube "slide"and fixed on a rail? 0 Answers
I'm making a top down game. Where should the camera point? 2 Answers
Different drag for each axis 3 Answers