user5113094
user5113094

Reputation:

Error with Quaternion.FromToRotation in Unity?

I get multiple errors whenever I run this code:

transform.rotation = Quaternion.FromToRotation (Vector3(0, 0, 0), Vector3(0, 0, 270));

Can you suggest a fix for this code?

Errors:

Expression denotes a type', where avariable', value' ormethod group' was expected

The best overloaded method match for UnityEngine.Quaternion.FromToRotation(UnityEngine.Vector3, UnityEngine.Vector3) has some invalid arguments

Argument #1' cannot convertobject' expression to type UnityEngine.Vector3

Upvotes: 1

Views: 888

Answers (1)

Jespertheend
Jespertheend

Reputation: 2280

Assuming you're using C#, you should use new Vector3() instead of Vector3

Upvotes: 5

Related Questions