Topic: Game won't play

Hello, I've been working on developing a game and have run into some problems. I am using Unity 4.6. I'm a 3-D animator but have little knowledge in coding, so I apologize if this is a novice question.

Essentially, when I hit the play button in Unity to try and test my game, the game will either not begin at all and only play the level music or the camera will swing low and you can't even see the stage. These are the codes that pop up about 999 times

NullReferenceException: GetRef
MoveSetScript.GetAnimationLengh (System.String animationName)
PhysicsScript.ApplyForces (.MoveInfo move)
ControlsScript.DoFixedUpdate ()
UFE.FixedUpdate ()


and then


transform.position assign attempt for 'MARS RIG FINAL(Clone)' is not valid. Input position is { NaN, NaN, NaN }.
UnityEngine.Animator:Update(Single)
MecanimControl:_playAnimation(AnimationClip, Single, Single, Boolean)
MecanimControl:Play(AnimationClip, Single, Single, Boolean)
MecanimControl:SetDefaultClip(AnimationClip, String, Single, WrapMode, Boolean)
MoveSetScript:fillMoves()
MoveSetScript:ChangeMoveStances(CombatStances)
MoveSetScript:Awake()
UnityEngine.GameObject:AddComponent(String)
ControlsScript:Start()


and then

NullReferenceException: Object reference not set to an instance of an object
MoveSetScript.ChangeMoveStances (CombatStances newStance)
MoveSetScript.Awake ()
UnityEngine.GameObject:AddComponent(String)
ControlsScript:Start()


and then

NullReferenceException: Object reference not set to an instance of an object
HitBoxesScript.UpdateRenderer ()
HitBoxesScript.Start ()


and then

NullReferenceException: Object reference not set to an instance of an object
MoveSetScript.IsAnimationPlaying (System.String animationName, Single weight)
MoveSetScript.IsAnimationPlaying (System.String animationName)
ControlsScript.validateRotation ()
ControlsScript.DoFixedUpdate ()
UFE.FixedUpdate ()


I have no idea what any of this means. Please can someone help me? I appreciate it, thank you!

Share

Thumbs up Thumbs down

2 (edited by roswell108 2015-04-08 21:03:56)

Re: Game won't play

Sounds like you don't have the character set up right.

Make sure you have a prefab with hitboxes assigned to a character asset with moves and (if mecanim) an avatar assigned to it, too.

Take a look at one of the demo characters to get a better idea of what all is needed.

Share

Thumbs up Thumbs down

Re: Game won't play

Thank you for your reply. I set up the hit boxes just as the tutorial demonstrated and configured a humanoid avatar for mecanim  animation. I also went through each animation and made sure the avatar was configured and through each move and made sure the proper prefab was selected.

It also did the same thing when only using the demo characters in the game.

Share

Thumbs up Thumbs down

Re: Game won't play

KJtheARTIST wrote:

Thank you for your reply. I set up the hit boxes just as the tutorial demonstrated and configured a humanoid avatar for mecanim  animation. I also went through each animation and made sure the avatar was configured and through each move and made sure the proper prefab was selected.

It also did the same thing when only using the demo characters in the game.

Did you drag the avatar into the spot under the moves list? I don't remember if that caused that type of error, but that was one thing that broke on mine when I forgot.

That is all I've got without looking at it, though. Hopefully someone else has some better ideas.

Share

Thumbs up Thumbs down

Re: Game won't play

Yes, the avatar is there under the moves list, I will try to adjust the hitboxes and see if that fixes anything

Share

Thumbs up Thumbs down

Re: Game won't play

Missing hitboxes are only a problem when you have any collisions.  If your game is having problems as soon as it starts, then I doubt that's the issue.

Are you using a custom stage?  Does the same problem happen when you use the default Training Room?

The falling camera problem is usually due to the stage - your ground plane is either missing the collision or is too high/low.  When creating your own stages, the best approach is to copy the Plane object from the Training Room stage so you have the exact right position/collision.

Also, the NaN issue is usually due to the animation clip.  If it's happening straight away, it's likely your idle clip is the problem.  Play around with the import settings of the clip and see if that fixes it.  I find chaining Body Orientation and Baked into Pose works in nearly all cases.

Share

Thumbs up Thumbs down

Re: Game won't play

Yes I use the default UFE stage, how do I check if it's for some reason missing the collision?

I baked the animation into the poses and now the NaN error is gone, so thank you for helping me on that. However, I am getting a message similar to this on several of my animations:

MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 L Thigh/Bip01 L Calf' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 L Thigh/Bip01 L Calf/Bip01 L Foot' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 R Thigh/Bip01 R Calf' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 R Thigh/Bip01 R Calf/Bip01 R Foot' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING' conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1' is between humanoid transforms and has rotation animation. This might lower retargeting quality.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1/Bip01 Neck/Bip01 L Clavicle/Bip01 L UpperArm' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1/Bip01 Neck/Bip01 L Clavicle/Bip01 L UpperArm/Bip01 L Forearm' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1/Bip01 Neck/Bip01 L Clavicle/Bip01 L UpperArm/Bip01 L Forearm/Bip01 L Hand' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1/Bip01 Neck/Bip01 R Clavicle/Bip01 R UpperArm' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1/Bip01 Neck/Bip01 R Clavicle/Bip01 R UpperArm/Bip01 R Forearm' has translation animation. It is not supported.
MuscleClip 'MARS_FALLING'conversion warning: 'mecanim:Bip01/Bip01 Pelvis/Bip01 Spine/Bip01 Spine1/Bip01 Neck/Bip01 R Clavicle/Bip01 R UpperArm/Bip01 R Forearm/Bip01 R Hand' has translation animation. It is not supported.



Also the camera is still falling through the stage only now it does it once the announcer says fight!

Share

Thumbs up Thumbs down

Re: Game won't play

Maybe other 3D artists (3DS Max I assume?) can chime in, I haven't seen the translation animation error before.  Are you doing anything unusual with animating the rig?

Have you tried changing the import settings of those clips too?

The camera still falling through the stage is a worry.  Did you edit the default training stage by chance?  Have you tried re-importing the stage to be sure? 

If the stage isn't the cause of the camera falling, then the characters must be falling through the ground for some reason.  What is the starting distance (default is -5 and 5 I believe)?

Share

Thumbs up Thumbs down

Re: Game won't play

So just an update;

I reimported all of my characters and baked all the animations, no error codes popping up for them anymore.

However, I am still having an issue with the camera and the stage. I am using the default stage and have reimported it numerous times. The camera falls immediately and all becomes gray. There are no error codes or anything and the starting distance is the default -5 and 5.

Share

Thumbs up Thumbs down

Re: Game won't play

You're definitely playing in the same stage you're reimporting?  (Check Global Options | Stage Options)

If you use default characters, does the camera still fall?

Might be best to grab a screen shot of your scene on the first frame it loads.  Press the Pause button at the top of the Editor, then press Play.  This will start the scene but pause the execution at the first frame.  If characters are falling, you'll be able to see this happen here (they will be lower than ground).  While paused, drill down the hierarchy into the Game\[Stage] object and see what it looks like.  Also check your characters.

Without seeing the project, I'm not sure what else to look at... :-\

Are you still on Unity 4.6? (You should be)

Share

Thumbs up Thumbs down

Re: Game won't play

Yes, the prefab of the default stage I reimported is the one used in the global settings, and yes default characters also fall through.

When I press pause and then play, the characters are standing normally. When I move to the next frame they start to fall. As i move up more frames they fall a little farther and then bounce back up and then fall down again but through the stage.

The hierarchy shows the training room, Player 1, Player 2, two debuggers, "Info" and camera fade. The characters are under player 1 and player 2 and look as they should.

Question: If I have changed the position of the main camera do I also need to change the camera fade position as well to coincide?

Share

Thumbs up Thumbs down

Re: Game won't play

The camera's position is controlled by script.  You can adjust the camera's behaviour in Camera Options.

The behaviour you describe usually happens when characters are spawning too far above or somewhere below the ground plane.

Are you sure there are no extra mods or changes to the base UFE install?  I would suggest re-downloading and importing UFE and starting a new project just to eliminate all possibilities...

Share

Thumbs up Thumbs down