Hi there. I’m very new at Unity, but I have a very specific question about a project I’m working on, so I’m going to explain myself.
I have an spheric racingpod like the one on Fig 1. In Unity, the seat in the middle is grouped as one and parented to the rest of the model. The overall model has attached two scripts that make it behave as a roller ball (in fact, these scripts are the ones that Standar Unity’s Rollerball has: “Ball” and “BallUserControll”), as well, my object has a Rigidbody and an Sphere Collider. On the other hand, the grouped seat only has the following script:
private float lockPos = 0;
void LateUpdate(){
transform.rotation = Quaternion.Euler (lockPos, lockPos, lockPos);
}

Fig. 1. Spheric Racingpod .
With that script I have locked the rotations of the seat, so when the sphere moves and rotates, the inside won´t rotate as well. Nevertheless, this is also a problem beacuse I don´t need the seat only following the position of the sphere, but also the Y axis rotation of its parent. Otherwise, when rotating it would look like in Fig. 2.

Fig. 2. Racingpod moving with all 3 rotation axis locked.
So, I did this:
private float lockPos = 0;
void LateUpdate(){
transform.rotation = Quaternion.Euler (lockPos, transform.eulerAngles.y, lockPos);
}
The problem now is that when the sphere moves forward, the seat does an automatic wierd rotation and ends up like in Fig. 3.

Fig. 3. Wierd automatic rotation when moving.
My question is: how can I make the seat follow the sphere but only in its Y axis with out making that wierd automatic rotation? I also don’t know if that rotation has something to do with the aceleration or general physics of the roller ball’s script. Any help (answer, explanation, etc.) will be very appreciated.
Finally, I have to say that I used too the Mathf.Clamp class to restrict the seat’s values of rotation, but I got the same results as in Fig. 2.
private float lockPos = 0;
float MinRot=1;
float MaxRot=1;
void LateUpdate(){ transform.rotation = Quaternion.Euler (lockPos, Mathf.Clamp(transform.localEulerAngles.y, MinRot, MaxRot), lockPos);
}
Thanks, guys, and sorry if this question is too basic and the post too long. Also, apologies for any grammar mistakes, I’m not a native English speaker.

