Hope this Helps: Code and A small tip

As of 12/30/2022(UE5.1) Use the below code also make sure you change the onbeginoverlap for the second AddDynamic. I just copied and pasted and took me 15 minutes to figure out I missed changing this. Also putting them in begin play worked form me instead of the constructor and I am not getting any kind of double messages.

/** called when something enters the sphere component */
UFUNCTION()
void OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

/** called when something leaves the sphere component */
UFUNCTION()
void OnOverlapEnd(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);

PS. Using Visual Studio Code with some plugins really streamlines the definition creation and other QOL.

2 Likes

Plugin as the extensions? May I ask what extensions you used?

In backed there is an extension called c/c++ definition generator. It lets you right click on you declaration in header files and puts the definition in the cpp file. I noticed it slow down when you have a lot of code because I think what it does is just find the end of the last line and plops it under. But it Carrie’s over any part of the definition and adds in the class body. Very convenient. I am also using extension pack and runner. I don’t know if those last two are needed but helps with my workflow. I can just build without any commands.

1 Like

Privacy & Terms