Hey all, weird one here.
I have a player prefab, just canabalized some code to make a simple movement function. It worked fine, player moved as expected. I was playing with mecanim transitions, specifically Idle -> Movement when, after hitting play, I get the following error;
MissingComponentException: There is no 'Rigidbody' attached to the "Player(Clone)" game object, but a script is trying to access it.
You probably need to add a Rigidbody to the game object "Player(Clone)". Or your script needs to check if the component is attached before using it.
UnityEngine.Rigidbody.get_rotation () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/NewDynamics.cs:907)
Player_Movement.Player_Rotation () (at Assets/Prefabs/Player/Player_Movement.cs:75)
Player_Movement.Movement_Manager () (at Assets/Prefabs/Player/Player_Movement.cs:52)
Player_Movement.FixedUpdate () (at Assets/Prefabs/Player/Player_Movement.cs:37)
I did no modification whatsoever to the code. It went from working fine to not working at all with a simple Mecanim exit time change. All scripts were saved, I assure you, nothing changed but an exit time on a transition.
Hoping this is a known bug. Using Unity 4.6 Beta, so that may be it. In any case, any help would be great! Last time this happened I had to create a whole new project, reimport assets, and remake all the scripts.
Also, if anyone knows why it now says "Clone" after my prefab, would appreciate it!
Thanks.
↧