I have object1(marble) and object2(player)
this script is on the player object
void Update ()
{
player.transform.position = new Vector3(marble.transform.position.x, marble.transform.position.y + 0.45f, marble.transform.position.z);
transform.LookAt(transform.position + marble.rigidbody.velocity);
}
All works fine, except all I need is that the player object to not rotate along its x and z axis.
How can I stop the player object to stay relative to the marble object, but to lock its x and z axis?
Freezing the x and z rotation on the player Rigidbody has no affect.
Can someone help?