Jump to content

how to determine which worldtrigger triggers callback when multiple worldTrigger use same callback function?


photo

Recommended Posts

I have multiple doors, and I want to use a WorldTrigger to controll each doors open and close, of course it's a same callback on each WorldTrigger.

 

But how can I know which trigger triggered the callback?

Link to comment

I've studied passage demo, the callback function are declared as this

void parking_doors_callback(Node node,WorldTrigger trigger)

 

and the document said The callback function should be able to accept a node as an argument, but in the function there is no usage of argument node.

 

is this the standard format of callback to WorldTrigger? document didn't say it clearly.

Link to comment

well, after some test, the default callback for WorldTrigger should be

 

void trigger_callback(Node n, WorldTrigger t)

 

Node is the object cause trigger to fire callback, and the second argument is the actual trigger that triggers the callback, but document didn't say anything about this, I think it will be better that the document could clarify this.

Link to comment
×
×
  • Create New...