Monitoring rotation and apllying it to something else.

Hi i have a gameoject that rotates, i would like to constantly monitor its rotation on the y axis and apply it to another gameobject.

How do I do this?

Thanks.

Hello @smindlon

This is Unity Answers. We are here to help. But you should take your time trying to solve your own problems. Your question is from lesson zero. Its more than basic. You should go to take your time watching tutorials about basics in unity.

You need to read and then apply rotation of an object in euler form (x,y,z) (Normally, rotation is represented in Quaternion variables, but its so much easy to operate in euler)

Transform.eulerAngles MANUAL

Then to apply a rotation component value to an object, you will need to create a new vector, so lets change the Z rotation component of an object called QWER, apllying the Z rotation of an object called ASDF

float Xrot = QWER.transform.eulerAngles.x;
float Yrot = QWER.transform.eulerAngles.y;
float Zrot = ASDF.transform.eulerAngles.y;

QWER.transform.eulerAngles = new Vector3 ( Xrot, Yrot, Zrot);

Good luck!

And remeber: learn > try > learn > try…