Some actos with the tag Homing are the same class as the player character, for example:
My player character is CH_Human, and some npcs are CH_human as well.
since the closest actor will always be the player character the projectiles always chase the player character that shot them.
in addition to check the distance, do a “get player character” and then do an == check on that. If it is the player character, leave the True branch empty.
So, in plain language what you’ll say is:
If the Actor is in range AND is not the player character, then…
Well, what if my character is driving a tank and the missile comes from the tank? since i posessed the tank, the character is no longer player controlled. Also how do i make it ignore allies?
In my game I have a class for projectiles, and it has a “expose on spawn” (check in the details panel to toggle that) variable for “who fired me”. This is an enum that has entries like, “player, enemy type 1, enemy type 2” etc.
Then on the projectile hit event I can just check that enum in cases where it matters.
Generate a unique string hash for the character. Add that string to “Actor Tags”.
In the projectile class create a string var, Name it “OwningHash”. Set the var to instance Editable & Expose on Spawn. Pass the characters hash to the projectile on spawn.
In your tracking logic check the OwningHash against potential Targets as an exclusion.
Otherwise, get the hash of tartget and define a “TargetHash”…trace logic for tracking should check each update.