- Home /
Vector2 = X/Z Instead of X/Y?
Hello,
I want to move an object to another.
So I tried to use vector3. The proble is, that the object isnt perfectly on the ground (its flying a bit) So its not possible to reach this object (On Y Axe).
So I want to use Vector2 to ignore the height.
But Vector2 only supports X/Y Axes not X/Z Axes.
Any idea how to solve this?
Comment
Best Answer
Answer by AnaRhisT · Jun 23, 2010 at 03:26 PM
Make sure there's a gravity on ur player, u can check if hits the ground which if((CollisionFlags.CollidedBelow) != 0){//code}
Is it possible to use gravity with box colliders? Or do I need Rigidbody?
use CharacterController - it applies gravity automatically.
Ok thanks, hope it doesnt need very much performance for many objects.