- Home /
Updating then calling gameObject from main thread. error
So I have a var name = gameObject; in the main thread, which is set
``by a raycast hit, so name = hit.transform.gameObject; but it seems that it isn't updating the var, and the ai just resets to o,o,o vector and it gives me this error/message
Look rotation viewing vector is zero UnityEngine.Quaternion:LookRotation(Vector3) lookatnew:AIStart() (at Assets/game/scripts/ai/enamie/basic/lookatnew.js:46)
what it is talking about.
}
else if (Aware && secondsSaved <= EndTime )
{
secondsSaved = seconds;
EndTime = Timer + SetEndTime;
46 var rotationFallow = Quaternion.LookRotation(LastSaw.transform.position - transform.position);
transform.rotation = Quaternion.Slerp(transform.rotation, rotationFallow, Time.deltaTime * Damping);
}
which LastSaw is the var.
the function is a InvokeRepeating started randomly, buecuase this is a simple look at and find ai, so could that be the problem that it isn't updating it? which here is how i start the InvokeRepeating;
InvokeRepeating("AIStart", Random.Range(0, 1.0), 0.01);
This hopefully is the last error on this code i am making, thanks for any help.
Your answer
Follow this Question
Related Questions
Need workaround for this line of code 1 Answer
error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer 3 Answers
Displaying a static variable from another script with OnGUI 1 Answer
Cannot implicitly convert type `UnityEngine.GameObject' to `UnityEngine.Transform' 1 Answer
"Object reference not set to an instance of an object" problem 1 Answer