Page 1 of 1

Surface Event Triggers

Posted: Tue May 15, 2012 9:17 pm
by Stevemata
First, say I have a dangerous surface, like Lava for instance, what would be the best way to detect the character controller coming into contact with the lava?

Re: Surface Event Triggers

Posted: Tue May 15, 2012 10:53 pm
by Norbo
Collision events or scanning the body.CollisionInformation.Pairs list for dangerous things like lava would do the trick. In either case, storing data in Tags will help identify objects. For example, the lava's Tag could be set to some lava game logic object. Then, in the event or the scanning process, you can check the collidable for that Tag. (Note that an entity's Tag is separate from its entity.CollisionInformation.Tag; the entity.CollisionInformation is the BroadPhaseEntry that represents the entity in the collision detection pipeline.)

If you want to handle persistent contact as opposed to a one-time event, the pairs scanning approach is usually more direct.

Re: Surface Event Triggers

Posted: Wed May 16, 2012 3:54 pm
by Stevemata
Right now my levels are a single imported static mesh, the only difference between a lava surface and regular floor surface is the texture. I would prefer not to use the tag property, especially since other data is being stored in it already. Would making lava a second static mesh be a quick and dirty solution?

Re: Surface Event Triggers

Posted: Wed May 16, 2012 4:49 pm
by Norbo
Would making lava a second static mesh be a quick and dirty solution?
Yup. Or, in other words, a useful and practical solution :)