Hi
this script allows an object to follow camera direction when it moves. but when camera above or under it. it goes up and down of the terrain. What i need is to make it move with the direction of camera X Z only.
moveH = Input.GetAxis("Horizontal");
moveV = Input.GetAxis("Vertical");
moves = new Vector3(moveH, 0.0f, moveV);
moves = cam.TransformDirection(moves);
rb.AddForce(moves * 20.0f);
Do i need to change TransformDirection ?