NullReferenceException SmoothMover+$SmoothMover$24+$.MoveNext () (at Assets/Scripts/SmoothMover.js:33) UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator) $:MoveNext() (at Assets/Scripts/SmoothMover.js:26) UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator) $:MoveNext() (at Assets/Scripts/SmoothMover.js:14)
and the code..
private var player : Transform;
private var rayhitPoint : Vector3;
var moveSpeed : float = 1;
function CoStart() : IEnumerator
function CoUpdate() : IEnumerator
function SmoothMover() : IEnumerator
Am I not sure what's going on here, but any insight would be greatly appreciated. Thank you.
*edit: sorry for the formating..first post and all :)
Click to move is quite simple:
You could find a lot of useful scripts here:
answered Jun 14 '11 at 01:25 AM
It's not moving because your not assigning a value to "smooth".
Set it to 1 or something in the inspector (or hard code it) then it will move.
issue is the speed is not constant wit this script, the further away from the object you click, the faster it moves.