Changing scene object materials on the fly
by Nerdy Inverse · in Torque X 2D · 07/29/2007 (8:27 pm) · 4 replies
What's the best way to change a T2DSceneObject material on the fly without using animated sprites ?
#2
07/30/2007 (7:06 am)
Quote:The drawback currently is that you have to have a static sprite already available for you to "get" the material from.Actually, that's not true. You can get a material from the TorqueObjectDatabase if you want, or even have a component property of the RenderMaterial type and assign the material you want in TXB.
#3
07/30/2007 (7:53 am)
Thanks for the quick reply, I'll try that.
Torque 3D Owner Will O'Reagan
Modern Intrigues
Heres an example of something you might write into a movement component.
T2DStaticSprite newObject = (T2DStaticSprite)(TorqueObjectDatabase.Instance.FindObject("ObjectTemplate") as T2DStaticSprite).Clone();then perhapsthen
WillO
MMI