Call Func from other Script

Every Event Dispatcher Receiver have to obtain a reference to the sender object. (In your binding Events you have to reference the sender)

Btw: You dont need to loop through all actors and call your Dispatcher. Dispatchers are listening relationships.
Call Dispatcher > everyone who is listening executes the bind event.

For setting the “movement/run mode” Dispatchers are fine. But you have to rethink your food eaten function. Imagine you have two collectables at the same time, you eat once and according to your dispatcher both collectables are fired. An interface would be much more easier because you can reference the receiver.

According to your name i guess you are german. Kannst mir auch gern auf deutsch schreiben :wink:

1 Like