Jump to content

[SOLVED] How to remove trigger


photo

Recommended Posts

Hi,

 

I have added PhysicalTrigger to editor through script using below step

 

trigger = add_editor( new PhysicalTrigger( Shape_BOX, myposition ) );

trigger.setEnterCallback("enterCallBack");

trigger.setLeaveCallback("leaveCallBack");

 

When I run the application, I am able to view the trigger & access it in Enter & Leave event. Now I want to know is there a possibility to remove this PhysicalTrigger using the script.

 

I tried to search in documentation, but unable to find it. Can anyone point the same.

 

Thanks

Link to comment
  • 4 weeks later...

Hello,

 

The trigger.setEnterCallback(0); works if I have only one trigger, but when I have more trigger it is not working. Below is the scenario where I have issue.

 

int size = 0;

for(int x = 0; x <= size; x++)

{

ObjectMesh mesh = add_editor(new ObjectMesh("TestWork/assest/worlds/meshes/sphere_00.mesh"));

mesh.setWorldTransform(translate(Vec3(x, 0, 0.25f)));

}

 

For each mesh Object I place an Physical Trigger using my custom object "trigger" over it's location & set respective callback (Enter & Leave)

 

trigger.setEnterCallback("enter_callback", x);

 

Now I am set triggerEnterCallback(0, x) in enter_callback() function after all my operation are done in this function

 

But the trigger is till existing, how can I remove the trigger in above mentioned problem.

 

Thanks

Link to comment
×
×
  • Create New...