The damage system is setup correctly with ‘instigator’ being a controller and ‘damage causer’ being an actor.
But Actor::GetInstigator returns a pawn instead of a controller (both function and variable do the same thing)
The damage system is setup correctly with ‘instigator’ being a controller and ‘damage causer’ being an actor.
But Actor::GetInstigator returns a pawn instead of a controller (both function and variable do the same thing)
Hey Taisaku,
Get Instigator is working as intended. It is supposed to return a reference to a pawn. If you want to get the controller, you can use Get Instigator Controller instead:
Have a great day
Is there a reason for the inconsistent terminology?
I wouldn’t say that the terminology is inconsistent, as the node is asking for the Event Instigator, which just happens to be a reference to the instigator’s controller in the Apply Damage node’s case.
From what I can see, the reason you’d want to have that controller reference is important for a setup where more than one controller is using the same pawn class, such as in a multiplayer setup. This would allow you to determine easily which player index caused the damage and apply any experience gains or other effects that you’d like when the player causes damage.
Let me know if you have any further questions.
When would the instigator not be a controller? Isn’t the controller how you find the player index? If you pass it a pawn without a controller there won’t be an index associated with it.
I would think the instigator should always be the same class, whichever one stores the player index, or to simply be an object reference.
Because if you just want the direct source or owner of the event, that should be passed separatly like it does in the damage system.
E.g damage from a bullet, the instigator is the object/player that set of the chain of events that results in the damage, and the source of the damage would be the bullet. This way you can properly maintain chains of events with the correct instigator and owners.
After discussion with our developers, it appears that this is currently working as intended. When working with instigators, you’ll just need to make sure that you’re plugging in the reference that the specific node is asking for.
So then what is the difference between an actor instigator and a controller instigator?
An Actor is going to be a lower in the hierarchy, meaning you could have just about any gameplay class as the instigator. As in, anything that inherits from Actor can be the instigator, such as Pawn, Character, HUD, GameMode, Controller, AI Controller, PlayerController, etc…
This includes anything you’ve created from Actor, such as weapons, projectiles, and so on.
Instigator is just a way to store a reference so you can then understand where it originated. If you wanted to have another reference, you can create your own in the class you’re working with and use that instead of the instigator, which could fix your issue with being limited to Pawn.