This is related to the RPG course on Udemy. I created two prefab variants of my original player prefab (player and enemy) and replaced the original player character with the new variant. Before doing this, everything was working as expected. However, after making this replacement, I began experiencing the following errors:
-
The follow camera now moves faster than the player. Both the camera and the player still respond to mouse clicks and move in the right direction, but they are out of sync.
-
My player movement function that calls StartAction from the action scheduler is throwing a null reference error following every click:
Sorry about the bad cropping; line 46 is GetComponent().StartAction(this):
Line 34 is GetComponent().MoveToNonInteractable(hit.point):
Line 17 is if (MovementRay()) return:
- When my “interact” animation is triggered, at the end of the animation the player freezes in place. Clicking away with the mouse causes the character to begin moving again.
Everything was functioning smoothly before the creation of the variants. I tried removing and replacing all the script components at both the root prefab and new variant level, as this seemed to work for someone else who saw some errors after doing this. Nothing I’ve tried has worked though.
Has anyone else run into anything like this? I’m using 2021.1.17f1