Hello, I have several objects that I can combine. They have a snap point. Where the origin of the next object is set to the SnapPoint position of the previous object and then assigned as children to this SnapPoint. When I select an object and try to rotate it, the first object goes 15 degrees as it should, but the next one rotates every 30 degrees and the third attached object goes 45 degrees. I tried to tweak something with the code but so far I have no idea. Could someone please help? ```public class ObjectRotator : MonoBehaviour
{
public float rotationAngle = 15f;
private GameObject selectedObject;
private bool isObjectSelected;
void Update()
{
// Check if the user has selected an object
if (Input.GetMouseButtonDown(0))
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
// Check if the object is not the plane
if (hit.collider.gameObject.CompareTag("Plane"))
{
return;
}
selectedObject = hit.collider.gameObject;
isObjectSelected = true;
}
}
// Check if the user has pressed the A or D keys
if (isObjectSelected && (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.D)))
{
// Rotate the selected object around the Y-axis
float direction = Input.GetKeyDown(KeyCode.A) ? -7.5f : 7.5f;
selectedObject.transform.rotation *= Quaternion.Euler(0f, direction, 0f);
}
}
}```