Scene objects don't seem to store the proper ObjectType
by Michael Vargas · in Torque X 2D · 04/29/2007 (6:17 pm) · 1 replies
When I assign a simple T2DSceneObject an object type in TGBX and then try to access that object's ObjectType property, I always get a type named "unknown", despite the fact that I know it has a type assigned to it.
I can fetch the type using
TorqueObjectType buildingType = TorqueObjectDatabase.Instance.GetObjectType("Building");
...but this won't match the type assigned to the scene object in TGBX. I simply want to check a scene object's type to see if it's a building or not. I would expect that this would involve the ObjectType property but that's not working. How do I do this?
Thanks,
Mike
I can fetch the type using
TorqueObjectType buildingType = TorqueObjectDatabase.Instance.GetObjectType("Building");
...but this won't match the type assigned to the scene object in TGBX. I simply want to check a scene object's type to see if it's a building or not. I would expect that this would involve the ObjectType property but that's not working. How do I do this?
Thanks,
Mike
Torque 3D Owner Will O-Reagan
Modern Intrigues
if (SceneObject.TestObjectType(TorqueObjectDatabase.Instance.GetObjectType("Building"))) { }thtas what I have been using, or something similar... I can't remember off the top of my head