TX 3.15. Controller IDs get mixed up on changing players.
by Matthew Hoesterey · in Torque X 2D · 07/22/2010 (3:26 pm) · 1 replies
In PlayerManager.cs The "_players" list is added to the first time you create players input maps. Thing is if you exit your level and have players rejoin (so that player 2 could become the new player 3 and player 3 could become the new player 2 ect...) The old input maps are still held as they are never disposed.
So when you reenter the game 2 controllers will control the same character as the manager binds the controller to an input map that already has a different controller (if that makes sense)
To fix this when I unload my level I created a function in PlayerManger that clears the player data.
I have a feeling I found an edge case as I'm guessing most peoples games would not ever have players switching their player number as you do in a fighting game.
So when you reenter the game 2 controllers will control the same character as the manager binds the controller to an input map that already has a different controller (if that makes sense)
To fix this when I unload my level I created a function in PlayerManger that clears the player data.
public void ClearPlayers()
{
_players.Clear();
}I have a feeling I found an edge case as I'm guessing most peoples games would not ever have players switching their player number as you do in a fighting game.
Torque 3D Owner Will O-Reagan
Modern Intrigues