I can’t seem to figure this out, I want my character’s head to tilt as he spins but rather than tilt it keeps turning and goes all “Exorcist”.
Here’s what I’ve got:
var bravelyHead : GameObject;
/* bunch of cut out code */
if (play == true){
if (dead == false){
bravelyHead.transform.rotate (0,0, spin);
}
}
The spin variable is has a max of 3 and a minimal of -3. It never goes past them.
I also tried:
bravelyHead.Transform.Rotation (0,0, spin);
But the moment I apply spin it crashes and I get an error message that says:
“NullReferenceException: Object reference not set to an instance of an object.”
What am I goofing up?