Is it possible to dynamically remove components from an object?
by Stephanie Miller · in Torque X 2D · 04/11/2010 (3:00 pm) · 3 replies
When my player dies, I want it to stop colliding with specific objects, but keep colliding with others. Is this possible to do? [solved]
#2
04/11/2010 (5:46 pm)
If you want the object to collide with some types of object, but not others, then you need be setting the CollidesWith property of the T2DCollisionComponent. Objects can be assigned TorqueObjectTypes and the collision component can be set to only collide with objects of the correct TorqueObjectTypes.
#3
SceneObject.Collision.CollidesWith -= ObjectType seems to work.
Thank you :D
04/11/2010 (9:23 pm)
Actually, I think I just figured it out:SceneObject.Collision.CollidesWith -= ObjectType seems to work.
Thank you :D
Torque Owner Cosmic Logic
What you can do is change your player's object.CollisionsEnabled property to false.