- Home /
Tap to Move Drag to Look Null Reference
Hello again,
I'm using a script i found on unify community, which was working fine until i upgraded from unity 3.4 to unity 3.5
http://www.unifycommunity.com/wiki/index.php?title=Tap_to_Move_Drag_to_Look_iPhone
Now i'm getting:
NullReferenceException UnityEngine.Transform.InverseTransformDirection (Vector3 direction) TapMoveDragLook.Rotate () (at Assets/Plugins/TapMoveDragLook.cs:190) TapMoveDragLook.Update () (at Assets/Plugins/TapMoveDragLook.cs:173)
When i comment out these lines the behaviour is very erratic, and only on the horizontal plane.
I'd love any input
Thanks.
Answer by siberman · Jun 28, 2012 at 05:27 AM
Fixed,
replaced cameraTransform assignation in Start() with
cameraTransform = Camera.mainCamera.transform;
I'll update the wiki, unless this problem was only me....