Game Development Community

Object Types

by James Kennedy · in Torque X 2D · 06/28/2007 (10:11 pm) · 1 replies

I have some T2SceneObject, and I want to check if some TorqueObjectType is in its ObjectType (made of multiple TorqueObjectTypes). I am trying to understand how TorqueObjectTypes work, and how you can compare them.
Thanks

#1
06/29/2007 (4:37 pm)
TorqueObject (the base class of T2DSceneObject) has a TestObjectType method:

// test for "corpse" object type on an object
if (myT2DStaticSpriteInstance.TestObjectType(TorqueObjectDatabase.Instance.GetObjectType("corpse"))
    Console.WriteLine("He's dead, Jim.");