Hi.
I am using RayCast to tell the player where to go to using my mouse.
So what i think that happens is that the middle of my character (which is a ball) is trying to reach the ground and because it can’t it does like a alittle jumping over and over.
Also it’s starting to fall through the ground at some point.
No errors are generated.
I have a rigidBody and a sphere collieder on my character.
I have a collider/ mesh (don’t know what it is called) on my terrain.
If you want to view a script please ask and i will post it here.
Please help me.
Ethan
The position of a spherical object, by default, is located in the direct centre of the sphere. Therefore you’re telling the centre of the sphere to go to a point on the ground … which it can’t get to because half of the sphere is under that point. So all you need to do is add half of the sphere collider’s Y height to the position before telling it to go there, like so:
Vector3 destination;
// calculate destination using raycasts here
destination.y += playerSphere.GetComponent<Collider>().bounds.extents.y;
// now tell the player to go to the destination