#can’t emit non-existing signal

12 messages · Page 1 of 1 (latest)

plush widget
#

signals declared as delegates cannot be emitted from outside of their parent class

#

meaning that you can only emit them from method of SignalBus

quaint ocean
#

You need to call EmitSignal on the instance holding the signal. eg: signalBusInstance.EmitSignal(signal_bus.SignalName.OnHealthChanged)

#

@plush widget: I'm pretty sure that's the same problem in your GH issue.

plush widget
#

probably

#

though in the same issue AddUserSignal with Connect also didn't work, and both use strings, so i don't see how instances would affect that

#

unless you aren't supposed to call Connect on external signals at all

quaint ocean
#

Connect needs to be called on the instance holding the signal, otherwise it can't find the signal name.

#

Signal names aren't global, they're scoped to the class holding them. So you need to call EmitSignal or Connect on the instance that has the signal as a member.

#

Or directly call Connect on the signal itself.

#

So in your Listener in the GH issue, you need to call EventBus.Instance.Connect("CustomHurt", ...)