How to use OnActorBeginOverlap c++ code?

The reason you want to put this in BeginPlay() is that UE4 uses class default objects, which have different behavior based on how they are constructed. There’s a thread on this that explains a lot. Make sure that you have NO runtime code in your constructor; for example, if you try to use a value that is a UPROPERTY() in the constructor, that variable value won’t be set by a Blueprint child class at that time, so you will get the default value.

What is CDO? - Programming & Scripting - Unreal Engine Forums.

3 Likes