How to pass curve from editor to c++ on dynamically spawned actor?

I’ve been looking over some curve tutorials on how to use curve from the editor in c++ classes. I’m trying to hand a curve reference to my actor class. However this class is spawned when I press “x”. So there is no way to select the “curve” uproperty and assign the curve BP. So I used another actor class that is already spawned and assigned it the curve in the details panel. Then I pass a reference to the dynamically spawned actor (because it is spawned from the actor class that is already spawned). Unfortunately this does not work. When I check if (curve) it does not succeed.

How can I get a reference to a Curve BP to a dynamically spawned actor?

I tried changing the spawn to a deferred spawn like in this post. Unfortunately this does not solve the problem. I thought the problem was that the actor did not exist yet so I could not pass the to the curve but that does not seem to be the problem after all.

Okay actually it looks like the curve is not being set on either Actor class. The class I was trying to set it on is already spawned in the level. It is saved with the level. When I select the curve in the dropdown for that uproperty and select it, then save I assumed this meant it was set.

I fixed this by some random combination of changing UProperty “edit anywhere” to " visible anywhere" and back, then reassigning in the details panel dropdown box and saving. It now appears to stay assigned.