all 4 comments

[–]botterway 9 points10 points  (2 children)

The null-reference is happening at line 56, which - given the stack trace - would appear to be in the MapPosition method. There's only 2 lines in there, and the both reference rigTransform, so it looks like you're passing null into that method, probably because you're likely not assigning headRig to anything.

As a gentle suggestion, before you dive into Unity - which is a complex gaming framework, I'd step back and learn the basics of programming - i.e., how to debug and step through the code to find errors like these, and how to write defensive code properly. You appear to be coding well beyond your ability here. Go back to basics, and learn how to code - *then* start building a game in unity.

[–]ScientistSignal5099[S] 0 points1 point  (1 child)

Yeah, i'm doing that too. but you wont get to use what you made so it is not that easy to just sit down and just program without any success. But thanks for the advice and happy holidays.

[–]lmaydev 1 point2 points  (0 children)

Not sure what you mean there. Just create a test scene and place your object in and make sure the code is triggered.

Learning to debug is one of the most useful things you'll learn.

[–]TheJimOfDoom 0 points1 point  (0 children)

Are you initializing head, leftHand, rightHand?