One UPROPERTY pointer for multiple instances

Hello i’m new to UE4.

I have an asset with parent class ADummy and UPROPERTY UDummyPlan *plan;

UCLASS() class TEST_API ADummy : public AActor
{
	UPROPERTY(EditDefaultsOnly, Instanced) UDummyPlan *plan;
};

UCLASS(EditInlineNew) class TEST_API UDummyPlan : public UObject
{
};

I want to make every instance that asset have the same UPROPERTY *plan pointer. So UE4 simply copied *plan like simple pointer without creating new object. But also keep the ability to create UDummyPlan object inline, when setting up the ADummy asset without creating a separate UDummyPlan asset.

Way you writing sounds confusing. Actors can not be assets, so i assume you mean Blueprints based of it i also assuming UDymmyPlan is asset class that you can create in content browser and what you want i assume you want ability to reference asset or create object for that perticilar blueprint ability to create in class defaults.

I think you could try to do something with detail customization:

make struct containg instance of object + potential asset reference pointer, reference is set use that if not use instantiated object, then make detail customization that will allow to properly set struct

you can also make cast override to make you struct be use as UDummyPlan* type:

https://en.cppreference.com/w/cpp/language/cast_operator

Nice example from engine is TSubclassOf that work as UClass*

Thanks. Sorry, I’m new to UE and English is not my native language. ) I can get confused in terms.

ADummy is actor class. In editor, I create asset based on it. In blueprint edit window in drop-down menu, I choose Dummy Plan, and UE creates DummyPlan_1 object. That is ok.

294252-uprop.jpg

Then I add some of this ADummy assets to the level, start PIE, log *plan pointers and they points to different objects. UE creates new DummyPlan object to every copy of ADummy placed in level. That is not ok.

I want all the *plan pointers in each ADummy based asset placed in level point to only one DummyPlan_1 object. And ability to setup DummyPlan parameters in ADummy blueprint editor.

294253-uprop2.jpg

I understand, I can achieve it in different ways, but it seems to me this is a much-demanded behavior, to have a very simple solution, like set certain variable specifier in UPROPERTY.