Overlaying the player actor with equips
by Michael Celey · in Torque X Platformer Kit · 03/05/2010 (1:35 pm) · 3 replies
I'm relatively new to the PSK and Torque X in general so please bear with me while I butcher this explanation.
I have my player actor and all of his animations working properly in the builder. At this point he's naked. What I'm trying to do is use different materials and have them render over the character to represent different armors. Right now I have the different armors as their own materials and made animations for them that line up with the player actor animations.
I tried mounting the armor to the player as its own actor but I couldn't get the armor to animate with the player when the player changed states.
Any tips?
I have my player actor and all of his animations working properly in the builder. At this point he's naked. What I'm trying to do is use different materials and have them render over the character to represent different armors. Right now I have the different armors as their own materials and made animations for them that line up with the player actor animations.
I tried mounting the armor to the player as its own actor but I couldn't get the armor to animate with the player when the player changed states.
Any tips?
About the author
Full Sail University graduate and indie game developer.
Recent Threads
#2
As of right now I have them animating together and lining up properly on idle. The only problem is that when the player is moving, the actor for the armor doesn't line up properly all the time. In the _preUpdate for the player I'm getting the armor from object manager and setting it's position to be the same as the player but even then it's not lining up for some reason. It could quite well be in the way that I'm doing it though.
Any help would be appreciated here.
03/09/2010 (10:12 pm)
Ten different armors, helmets, weapons, boots, and gloves. The number of different configurations would just be too much art to make. I've been working off an idea that was given to me by a poster in another thread where it was suggested to remove gravity and use the same controller as the player to make everything line up properly. As of right now I have them animating together and lining up properly on idle. The only problem is that when the player is moving, the actor for the armor doesn't line up properly all the time. In the _preUpdate for the player I'm getting the armor from object manager and setting it's position to be the same as the player but even then it's not lining up for some reason. It could quite well be in the way that I'm doing it though.
T2DSceneObject Armor = TorqueObjectDatabase.Instance.FindObject<T2DSceneObject>("BurlapArmor");
if(Armor != null)
{
ActorComponent armorPiece = Armor.Components.FindComponent<ActorComponent>();
if(armorPiece != null)
{
armorPiece.Actor.SetPosition(this.Actor.Position, true);
armorPiece.SceneObject.SetPosition(this.SceneObject.Position, false);
}
}Any help would be appreciated here.
#3
03/10/2010 (3:24 pm)
I was able to solve this problem using the above code. I was forgetting to set the masses and jump forces to be the same for each item... silly me.
Torque 3D Owner David Cox