Issues with On Actor Begin Overlap and Player Start

So I was trying to set it up so that when my player overlaps with a box trigger, it turns on a light. The problem is that using player start, the player is created at runtime, so the code breaks down when it doesn’t have a target. The actual code works, I tested it in the Third Person demo map, but not on a custom map.

P.S. I’m using blueprints, wanted to make that clear as I said “code” a few times.

It shouldn’t matter whether the player is spawned at runtime or placed in the world. Unless you are trying to use a reference in the level blueprint for the “placed” player character and then replaced that character with the “player start” then the reference would be null. A simple “cast to player character” would work just fine in any situation.

Thanks, will try it out now

Yep! The solution was simple. All I had to do was replace the Player reference that I had placed in the level with “Cast to Player” and use the “Get Player Character” as the object. Much appreciated!