AddDynamic removed?

I’m trying to subscribe to the OnComponentHit event. According to documentation and other sources on the internet I should use the .AddDynamic but I’m not able to find this function.
What is the correct way to subscribe to the OnComponentHit event?!

As you can see there is no AddDynamic in the list.

229622-noadddynamic.png

In your header file:
private:

229614-onhit2.png

public:

in cpp CONSTRUCTOR:

in cpp:

Straight from my 4.18.3 project, compiles and works.

No you dont, your image just became visible for me. You are doing 2 things wrong.

  1. you dont addDynamic in Constructor but in beginPlay.

  2. You don’t have are binding to nothing, you forgot that OncomponentHit is a member of a component

I have exactly the same but still no AddDynamic. I’m updating my editor from 4.18.2 to 4.18.3 now maybe it will solve the problem.

229628-noadddynamic.png

On a UBoxComponent in the constructor the only difference we have right now is that you are using a sphere instead of a box right?

I’ve fixed the problem. It had nothing to do with the API it was just InteliSence being weird. I’ve just typed the .AddDynamic without the autocompletion and it works now.

Thanks for the help

1 Like

CollisionComp = CreateDefaultSubobject(TEXT(“SphereComp”));

This (or simmilair) must also be in the constructor, before the addDynamic