K
K
KraGen.Developer2022-04-13 22:09:40
Unity
KraGen.Developer, 2022-04-13 22:09:40

How to instantly reset the rotation values ​​to zero?

Good day, there is a GO that uses rigidbody, the "Use gravity" checkbox is disabled because of this GO, so it flies freely. There is a method in which this GO needs to be spawned in a certain place and with the rotations thrown off. Tobish everything to zero. How to implement this, because I am looking for, but there is no such thing as new Vector3 (0,0,0) by type. Help who can

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GFX Data, 2022-04-14
@KraGenDeveloper

var spawn = Instantiate(source);
spawn.GetComponent<Rigidbody>().rotation = Quaternion.identity;

M
Mimocodil, 2022-04-13
@Ezekiel4

Try
transform.eulerAngles = new Vector3(x, y, z);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question