Hello UE4 community, I’ve hit a stump in my project and need your help.
TL;DR: I can’t get the editor to display the changes I made to AISenseConfig_Sight.h in Visual studio.
Basically my game has AI that uses the AI Perception component’s “Sight radius” but the problem is I need to change the sight radius for each AI based off level so I figure I’ll do that within the construction script but the catch is the variables that I need access to (“Sight Radius” and “Lose Sight Radius”) is not exposed to blueprint so I’ve embarked on a journey to learn enough C++ to dig in and expose this variable.
I found these lines in Visual studio under Engine\Source\Runtime\AIModule\Classes\Perception\AISenseConfig_Sight.h - Which was locked to read only but I disabled that so I could save my changes.
/**Maximum sight distance to notice a target. */ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Sense", config) float SightRadius; /** Maximum sight distance to see target that has been already seen. */ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Sense", config) float LoseSightRadius;
So I figure the solution would be to make the following changes. (EditAnywhere, BlueprintReadWrite).
The Zs in the comment were put there to let me know in the editor if my changes took effect since I should see that change in the description of “sight radius” within the editor.
Unfortunately I cannot get the editor to recognize any of my changes, at least the change of adding the Zs in the comment should display so my current hold up is getting the editor to react to these changes. I’ve built it with the UE4 project open and closed several times, rebuilt and cleaned, built in UE4, pressed compile in UE4, Refreshed Visual studio project, and rebooted dozens of times. I just can’t get the changes to take effect. Surely I’m doing something completely wrong but I just can’t figure it out, any help will be greatly appreciated!