How to work around that "Can't Save" issue if you can't see Patrol Elements in BP

If you’re like me, when you designed your PatrolRoute class, you didn’t see any reason that you would ever want to set your patrol points in the Blueprint. Logically speaking, it wouldn’t make sense, you want a blueprint that can move from level to level, so referencing actors specific to a level would be a disaster… So, I declared my array as

 UPROPERTY(EditInstanceOnly, Category = "Waypoints")

This had the expected behavior, that I could edit Guard 1 and Guard 2’s waypoints (Steve and Harry, if you named them like the video), but you can’t edit them in blueprint.

So… when I applied Guard1’s settings to the Blueprint, just like in Ben’s example, it put Guard1’s patrol route into the blueprint patrol route, and I dutifully tried to save and got the same very ugly “you can’t save this because of references” error… only… where Ben just went into the Blueprint and deleted the offending waypoints, they simply weren’t there for me…

Solution? I changed the UPROPERTY on the TArray

 UPROPERTY(EditAnywhere, Category = "Waypoints")

then compiled within Visual Studio. When the compile finished, I headed back into Unreal, where it tried to save again (it likes to save all when you recompile, which is why I needed to compile within VS). I chose don’t save and it finished the Unreal part of compilation.
Badabing, Badabang, I was able to remove the offending waypoints, save, change the header back the way it should be and breath a sigh of relief.

Probably took the long way around just saying "if you find you can’t remove the waypoints, make sure you’re UPROPERTY is set to EditAnywhere.

3 Likes

I ran into the same problem. My solution was to

  1. Remove the Patrol Points from one of the instances (i.e. Steve)
  2. Edit Blueprint > Apply Instance Changes to BP
  3. Re-assign the patrol points on each instance of the Patrolling Guard. (I know, boring)

This is a very similar solution but saves two compilation cycles and you can keep EditInstanceOnly.

1 Like

Yes two valid solutions. I prefer the second one though as it is faster and allows one to keep planned design.
What I would like to do is being able to create an array of waypoints outside of the character, and directly assign the array to the component instead of creating an empty array and filling elements one by one, that way a patrol could be shared between several characters.

Hi,
If you can not see the patrol array elements like me, just click here and you would be able to edit it.

thanks for posting

you saved me a lot of time

Privacy & Terms