Hey all. I’m trying to cast to the other actor that overlapped a spherecollision component. I want to verify it is either AI or player that overlapped. The player character actor cast works, but the AI_Character does not and always fails. I’ve tried connecting it several ways and can’t seem to get it to work. Thanks!
Controller doesn’t have collision. You need to get the controller from the actor and then check if it is valid or cast to your AI controller.
This one works.
The reason behind the duplicate cast to player is because I haven’t implemented the AI side yet, so I make both branches do the same thing.
Hi MMMarcis. I tried it like this, still no luck. I also used the AI_Character itself, still nothing.
You’re casting to player character if the cast succeeds or fails. You should only cast to the player if the cast to AI fails. Can you print out what’s overlapping with the print string node? I think you might be casting to the wrong class or overlap doesn’t trigger.