Home Game Development c++ – UProperty of AStaticMeshActor sort resets to “None” after choosing in Editor

c++ – UProperty of AStaticMeshActor sort resets to “None” after choosing in Editor

0
c++ – UProperty of AStaticMeshActor sort resets to “None” after choosing in Editor

[ad_1]

I’ve an C++ class “Manager” that derivatives from AActor.
Inside of it, I’ve a property of sort AStaticMeshActor:

UCLASS(Blueprintable)
class MYGAME_API AManager : public AActor
{
...

UPROPERTY(BlueprintReadOnly, EditAnywhere)
        AStaticMeshActor* actor;

When I run the Editor and place my “Manager” in scene, I can see it having the “actor” member. I can see the drop-down there itemizing all my StaticMeshActors in scene, however as soon as I click on on any of them, the fields get’s again to “None” as a substitute of chosen actor.

enter image description here

The mesh actors that seem in checklist are simply plain regular actors spawned in scene however drag-and-drop meshes from content material browser (so the AStaticMeshActor is created and positioned in identical scene because the Manager is).

Note: When I alter property sort from AStaticMeshActor to AActor, I’ve checklist of my my static meshes + another actors and if I decide one other actor (some customized Blueprints inherited from Actor), they really fill the sphere and it’s now not “None”. When I swap to static mesh actor, it’s get “None” as a substitute of chosen mesh in scene once more.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here