Need Unity package for source code

I have progressed thru the ‘Grid Visual’ session but now my code fails, I miscoded some lines. I get a ‘NullReferenceException: Object reference not set to an instance of an object
MoveAction.GetValidActionGridPositionList () (at Assets/Scripts/MoveAction.cs:57)’ error. I have spent too many hours going back over my code using the This Lecturer’s Project Changes for the different sessions and I have not found my mistake. Is there anywhere I can download the complete game so I can find my error?
The ‘moveAction = GetComponent();’ works in the Uniit class, Awake function but then later on the moveAction is null???
Thanks.

Yup all the Lectures have a commit on GitLab, here is the one for this lecture Move Action Validate https://gitlab.com/GameDevTV/unity-turn-based/Turn-Based-Strategy-Course/-/commit/afe3effa566179027f3f824dfbb57af7b5b792d9

Are you perhaps destroying the MoveAction component? That’s the only reason why that field would suddenly turn null. Maybe you are seeing code running on two different objects? Add a Debug.Log(transform); to see where that code is running.

Thank you. I don’t know how I missed this link from The Lecturer’s Project Changes screen. oops.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms