AI Runs to World 0, Deals Damage Upon Moving

Hey all,

I’ve been plugging away on a project at home and am running into and issue that I now need some help with. I had converted my enemy characters movement, health, and damage to actor components from just living inside of their BP. This worked fine. Then, I switched what my gamemode was reading as player character (from ThirdPersonHero to simply “PlayerCharacter” - ended up switching due to a migration of an old project.) This is where things go wrong. Spawned enemies will run to world 0,0,0 and seemingly will do damage as soon as they begin running towards their destination.



Relevant BP:

I’m not entirely sure whats going on. I want to think that the AI read my location as world center and just run to it - but have no idea why their “attack capsules” are overlapping with the character to inflict damage (as you can see by the debug readout, it looks like they are damaging me as soon as they move…) Getting actor location, the readout seems accurate…if I mess with “Player Location” at all, it seems like the AI run towards the player character for a few meters, then just run directly to 000 - but that may be just my wishful thinking.

Any idea what could be happening?

I think your return nodes are the wrong way around in Get Player Location. The successful cast is currently set to 0,0,0, while the failed cast is set to the player location. Try switching them around. I would probably also have a ‘Success’ boolean as an output and tick that for the successful cast - that way you can check with a branch outside the function whether the AI has found a player or not.

Hope this helps. :slight_smile:

Ah! What a noob mistake, thanks that definitely helped