K
K
KraGen.Developer2021-09-14 16:37:37
Unity
KraGen.Developer, 2021-09-14 16:37:37

Transform.Rotate - continues to twist further?

Hello, in general, there are two objects, the first one I rotate with swipes, and the second one should rotate identically to the right one BUT only along the Y axis. In general, I made the following script:

public Transform Target;

float rot = Target.transform.rotation.y;
gameObject.transform.Rotate(0,rot,0);

and in general, when I turn the first object, the second one moves in the direction of rotation constantly. And it is necessary that if about. 1 was rotated by 90 * then the second also turned by 90 * and was identically rotated in general. If anyone has any suggestions please write. I will be grateful

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yura Milevsky, 2021-11-13
@Hackerman1

You didn't specify an if, judging by your code here. Naturally, it will spin forever.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question