Im both teaching myself c# and how to use unity so im a massive noob. Im trying to create a flying character which can fly to a max height then stop, this is what i have…
if(rigidbody.position.y == 100)
{
rigidbody.velocity = Vector3.zero;
rigidbody.angularVelocity = Vector3.zero;
print("max height reached");
}
My character does not stop and max height isnt printed so i know it is not registering the height of rigidbody.
I know its simple but i only have a simple understanding of c#, any help would be great.