I am a little confused. I made an enemy blueprint. On BeginPlay he casts to the player and creates a reference. Yet, when the reference is called the error shows up. Why is that? This is the code that calls an error. It seems to be happening on multiple occasions.
Hook up a wire with a Print String node to Cast Fail - if you see it print when you start the game, the reference is not being set hence the Access None errors popping up.
Ha, I must use that node so much Iv completely forgotten cast failed existed. Anyway no, CAST FAILED was never called. It is definitely casting every time, which doesn’t make sense.
And just to confirm, the event Begin Play we see above is in the Gunman blueprint, right?
What are the chances you set Player variable to null someplace else? You can right click the Player node and search for references, using the binoculars icon will allow you to search outside of the current blueprint, too.
Is the enemy placed into the level or spawned? It looks like begin play might be getting called before the player exists, so its setting the reference as null, although I’m not sure if that cast would succeed then. (You could test this by putting a delay before the cast).
It might be easier and more reliable to just drag off the overlap event “Other Actor” pin and use that to cast to the player character, then do your component overlap check.
Also just to clarify, the begin play is inside the same blueprint as the overlap event correct?