Game Development Community

Move = null on respawn

by Dan Pascal · in Torque X 2D · 11/02/2007 (8:57 am) · 2 replies

When I respawn my character which has the MovementComponent, I lose movement control.
I debug: in the ProcessTick method of the new spawned MovementComponent, the "move" parameter, which should have the snapshot of the controller input is NULL. Since this is called by the engine, it is most mysterious...

I know it's difficult to diagnose without me getting into details, but what could be causing this?
The input map?

#1
11/02/2007 (9:32 am)
I know this is possible, I spawn a new player with a MovementComponent all the time. Without seeing code, it's tough to say. Within the MovemementComponent, you need to ensure that PlayerManager.Instance.GetPlayer(playerIndex).ControlObject is called in some way to designate that the scene object is bound to the player input. If the move parameter is always NULL, I would guess that its a binding problem somewhere, because you have an instance of the component, you see something on screen, and you are receiving ticks.

John K.
#2
11/02/2007 (10:47 am)
Hey John, I checked PlayerManager.Instance.GetPlayer(playerIndex).ControlObject
it's being called and all the variables are being created and assigned....
nasty bit of trickery

I'll post the code with the next installment- bugs included; maybe you can shed some light on it then,

Thanks