Hey all, hope everyone is well.
Just got a quick question about the AIStimuliSourceComponent, I have written what I believe to be the regular way to create a component and set up some basic properties however I seem to have run into a problem.
I have an object in this case some metal racking and have placed a stimuli component on said racking and used the code below to set that up.
Stimulus = CreateDefaultSubobject<UAIPerceptionStimuliSourceComponent>(TEXT("Stimulus")); SetupStimulus();
Stimulus->bAutoRegister = true;
I do not get any compile errors and no crashing or anything of the kind, however, it doesn’t seem to actually register the item as the AI does not detect it. However, when I add the component inside the blueprint and set the same values in the BP editor (auto register and sense_sight) it works perfectly. I was just wondering if I’m possibly missing something important which is causing it not to work when done in C++.
The blueprint class is a child of the main C++ class so I can see the component does appear inherited in the bp editor however it’s default values are not those that I set in the following lines, they are in fact empty.
Would be grateful for any help Thank you!