So I've go all my objects inside a empty gameobject and I want to rotate the parent with this:
public void XRotation (Transform _xRotObj, float _xRotPower)
{
float newRotation = _xRotObj.eulerAngles.x + _xRotPower * Time.deltaTime;
_xRotObj.rotation = Quaternion.Euler(new Vector3(newRotation, 0.0f, 0.0f));
}
But all the objects inside the parent get rotated around there own pivot, how can I rotate the parent without the object rotating individually.
I found the RotateAround but this doesn't work either.
This is what the the object looks like(Just some loose cubes inside a emty game object)
This is what happens when it rotates:
They rotate around a wierd pivot point.
float newRotation = _xRotObj.rotation.x + _xRotPower;
it should probably befloat newRotation = _xRotObj.eulerAngles.x + _xRotPower;
– maksymiuk