Why this isn’t do anythig when it’s executed?
transform.rotation.SetFromToRotation(transform.up, transform.right);
Why this isn’t do anythig when it’s executed?
transform.rotation.SetFromToRotation(transform.up, transform.right);
go figure.
You can use:
var quat : Quaternion;
quat.SetFromToRotation(transform.up,transform.right);
transform.rotation = quat;
or just
transform.rotation = Quaternion.FromToRotation(transform.up,transform.right);
Last one worked. Thanks!
Looks like it is unity bug…
It’s not a bug, it’s just you that don’t understand how value types work.
Enlighten me)
SetFromToRotation(transform.up, transform.right) is local void function. What it does if it’s not affecting quaternion from which it was called?