0
Answered

How do i use custom events?

Sanket Varia 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 5

For some reason trigger custom event node is not working. IDK what i have done wrong. I've double checked if the string was correctly written on them. rest of the functions work perfectly but i am being unable to trigger a custom event. help please.

Is it possible that it will not work if trigger and custom event both has different game object attached to them? As soon as i attached equal one it worked.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by Sanket Varia 4 years ago

The object has to be listening for the custom event for it do anything when it receives it.  However, as long as the target is listening for the event, you should totally be able to call a custom event on a different object.  Can you create a small test and post the graph? 

Some how its not working. If both trigger and custom events are having different game object attached to them, they do not work. It doesn't give any error, it just doesn't works unless they are attached to same game object. i'll share a screenshot later tomorrow.

Pending Review

The object you trigger the event on has to be the same one that is listening for the event. That is the purpose of this target port.

This was possible in C# script so i thought it should be possible in Bolt, But i guess according to you it doesn't so you can turn this into an idea :)

Answered

Well, can you explain a bit more what you expect to happen?

If you want a "global" event, the trick right now is to send and receive all events from a single "event manager" empty game object in the scene. This will be made simpler in the future with custom event definitions.