C++ Declaired AActor* keeps unseletecting

i have made a AActor* Key; and i’ve made it a UPROPERTY so i can select which mesh is the key, but for some reason the mesh that i select will unselect it self which will cause my game to crash, any reason why it would un select it self and is there a way to prevent that from happening?

the information u are gibving is a little lacking.

u could try to use:
UPROPERTY(EditInstanceOnly) or UPROPERTY(EditDefaultOnly)
TSUBCLASSOF Key

Editinstanceonly(means u can select a mesh for every istance or one default mesh for all)

TSUBCLASS is basicly a safe pointer, which might be needed forthe blueprints to save ur selection. im pretty newb too


if both isnt working u need to debug using GameEditor build, and see in ur begin play/constructor etc whats happening with the variable.