I have a rigidbody entity in a wmb level, PhysX enabled. The entity is able to collide with the level blocks and rebound appropriately.
One thing's stumping me... I want to be able to set my entity's variable 'shield' to 0 when it collides with the level blocks, but I haven't figured out how.
Below is my attempt, which the program does not understand. Is there something wrong with the code, or the wmb level blocks?
-----------------------------------
var shield = 750;
function collision()
{
if (event_type == EVENT_BLOCK) {shield = 0;}
}
action zfxengine()
{
pXent_settype (me, PH_RIGID, PH_BOX);
pXent_setmass (me, 0);
pXent_setgroup (me, 2);
my.emask |= ENABLE_BLOCK;
my.event = collision;
while(1)
{
...
...
}
}