MoveToward and LookForward problem

uhm i want to move my main object between two vector3.points - the following code should move it between the two points. (it works but the problem is that this gameObject isnt grounded when it is moving)

wolf.transform.position = Vector3.MoveTowards(currentPos, targetPos, step); wolf.transform.LookAt(Vector3(characterPlayer.position.x, transform.position.y, characterPlayer.position.z));

you can see i use Vector3.MoveTowards and transform.LookAt. Basically im not sure if it is possible to move this object on the ground if i use this two functions, because it interpolates the height of the two target Points (vector3) i have made.

on the wolf, there is a character controller which i gave a gravity in my code.

my question:

1.is it possible to make a object grounded, if it uses two target points i set up in my scene? i have to call the x and the z axis and not the y axis if i want to give him the target.coordinates

like wolf.transform.position = Vector3(targetPoint.x, ???, targetPoint.z);

i dont know how to declarate that the wolf shouldnt orientate the y position of the target points - but how can i do that? or is it basically possible?

  1. The Colliders doesnt work. The GameObject goes trough the ground mesh and trough obstacles i`have placed in the scene. is there a reason for that?

i hope someone has some experience with that kind of problem. or an alternative how i can move the object between the two targets - without MoveTowards and LookAt function.

Thank you so much :slight_smile:

do someone got an idea? this problem is very frustrating…