Hello
For context, I’m making a turret AI. The turret will run it’s little enemy cycle and all is good there. The way I have chosen to set what it attacks is using a target variable. The problem comes at accessing the target’s variables because the turret checks if the variable “Dead” is false and the “Class” (team) is not it’s own class. I would use Casting to the pawn blueprint, but you can imagine that not everything is a BP_FirstPersonCharacter. I do know (but haven’t tested) that I could just do cast, cast failed, and repeat, but that’s extremely inefficient and not flexible. I would use interfaces, but sending variables doesn’t matter if I need an individual interface for each pawn. Or maybe I don’t, and I just don’t know how interfaces work.
Thank you
The whole point of interfaces, is you can send the same kind of variables to any actor type. Also get them.
To get a variable from 3 different actor types can be done with one interface.
1 Like