Game Development Community

Animation Error As Soon As Soon As I Move Player

by Ben Hale · in Torque X Platformer Kit · 12/03/2010 (12:17 am) · 4 replies

Hope someone can help with this. I've barely gotten into the Platformer Kit and I hit an error. I'm doing the first tutorial where I make 2 platforms to jump between. Everything is fine until I add the "PlayerControlComponent". I load up the scene and everything is fine. Once I hit the control stick, the sprite will move for a second and the following error pops up.

NullReferenceException was Unhandled

Object reference not set to an instance of an object.

Referencing this line of code:

actorAnimMgr._actorComponent._animatedSprite.AnimationTimeScale = 1.0f;

Anyone know how I fix this. Not sure what use the kit is if I can't put a player in there.

Thanks.

Sman118

About the author

Recent Threads


#1
12/03/2010 (7:42 am)
Take a look at the demo, and how the scene's players are set up, then take a look at the rollout on that player component. You want to make sure you are using that component properly, or write/modify a player component that conforms to your art specifications...

Which component are you trying to use? Is it just called PlayerControlComponent, or is it the PlayerDragonActorComponent?
#2
12/03/2010 (11:19 am)
You need to use the PlatformerDemo project, not the Platformerstarter in order do follow the tutorials. Also, make sure to use the PlayerDragonActorComponent.
The Platformerstarter project is really a barebones version. The tutorials work fine when you use the PlatFormerDeo project.
#3
12/03/2010 (11:30 am)
First off, thanks for the speedy replies.

I'll try the PlatformerDemo when I get home tonight. Should I be using that for all of my game creations (outside of the demo)?
#4
12/03/2010 (1:32 pm)
The PlatformerDemo is a demonstration of what can be done using the platformer framework. If you are going to create a platformer with similar game mechanics like the demo, then it makes sense to use the platformerdemo project as a base. I just merged it yesterday with the GUI Sample as a base for my project.