I have this line that works in Javascript, but I am converting the project to C#, where it displays the errors below. rotate is a Quaternion, inputPosition and centrePosition are Vector3.
rotate = Quaternion.LookRotation(inputPosition - centrePosition, Vector3().forward);
Assets/myScript.cs(60,90): error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected
Assets/myScript.cs(60,45): error CS1502: The best overloaded method match for `UnityEngine.Quaternion.LookRotation(UnityEngine.Vector3, UnityEngine.Vector3)’ has some invalid arguments
Assets/myScript.cs(60,45): error CS1503: Argument #2' cannot convert object’ expression to type `UnityEngine.Vector3’
Any suggestions?
JamesLeeNZ:
Vector3.forward
no ()
Thank you very much. It always seems that the simplest things are the hardest to spot.