Apress / Devel-2D-Games-Unity

Source Code for 'Developing 2D Games with Unity: Independent Game Programming with C#' by Jared Halpern
https://www.apress.com/us/book/9781484237717
Other
215 stars 53 forks source link

Null Reference Exception thrown but is set to an instance of an object #28

Closed Arnmazing23 closed 4 years ago

Arnmazing23 commented 4 years ago

I accidentally deleted RPGGameManager Prefab and I recreated it. Now I'm getting a null reference Exception but I check the code and it is set to an instance of the object. I check virtual camera when game is running and virtual camera isn't following the player even when the tag is set to "VirtualCamera". I checked all the prefabs in inspector and everything is correctly attached. RPGGameManager has PlayerSpawnPoint and RPGCameraManager, PlayerSpawnPoint has PlayerObject attached, RPGCameraManager has the script attached to it.

JaredHalpern commented 4 years ago

Seems like you were able to resolve this. Thanks for closing out the issue!

Arnmazing23 commented 4 years ago

Yes!

On Tue, Jun 16, 2020, 1:43 PM Jared notifications@github.com wrote:

Seems like you were able to resolve this. Thanks for closing out the issue!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Apress/Devel-2D-Games-Unity/issues/28#issuecomment-644911684, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJTWR2B27YUD3JPNQBD3HTRW6VNJANCNFSM4N2XZ3VQ .