Can't edit Mesh in the Editor with UPROPERTY

expanding the screenshot field of view, it should look the same to both of us

But still, the girl in the video see the StaticMesh “Browser” instead of the white drop-down menu at the top… maybe it’s just a different version…

There is no difference. It’s just the difference between 4.10 and 4.17

You also must take into account the fact that you are also missing specifiers that are being used for the StaticMeshComponent in the tutorial. You can see its declaration here: C++ Battery Collector: Adding Variables & Functions | 04 | v4.9 Tutorial Series | Unreal Engine - YouTube

Thank you for the screenshot. I see why you aren’t able to edit it now. You are looking at this inside of a blueprint. If you wish for this UStaticMeshComponent to be accessible in Blueprints, you’ll need to use the BlueprintReadWrite, or BlueprintReadOnly if you only want to see it, specifier in your UProperty declaration as well. It is also not always safe to assume that a Component is going to work the same way as a variable, as they are vastly different. There is not a gap of documentation in this respect, as there are resources that explain this such as this tutorial: https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1gYup-gvJtMsgJqnEB_dGiM4/

Another thing to keep in mind is that UE4 is an ever changing engine. I understand that the lay out may have been different in 4.13 but there have been many changes since then. If you do wish for the editor to stay the same, there is nothing wrong with staying on an older version of the editor for development, as upgrading to a newer version will often pose problems for existing projects.

The only difference with the video is that SHE uses VisibleAnywhere and I use EditDefaultsOnly

WITH EDIT-DEFAULTS-ONLY

WITH VISIBLE-ANYWHERE

With EditDefaultsOnly (screenshot 1) I see a lot more things than VisibleAnywhere.
But I can also see the NAME OF THE VARIABLE (identifier) that I gave: MeshComp

With VisibleAnywhere (screenshot 2) I only see the part where I’m allowed to choose a StaticMesh for my StaticMeshComponent
BUT I can’t see the name of the variable that I gave (MeshComp).
Instead, I just see “StaticMesh”

ALSO, with VisibleAnywhere the Category of the Component is no longer “MyMesh” as I decided through the code and as EditDefaultsOnly correctly shows…

Is there a logic behind all this?

You’re also missing that she is also using meta = (AllowPrivateAccess = “true”) which is very important when using a Private variable, or one set to VisibleAnywhere.

Although, I agree that the Mesh should not be editable when the VisibleAnywhere specifier is being used. I’ll be looking into that, but your original issue (of not being able to edit your mesh) should be solved, so I’ll be marking this as resolved. I’ll update here with whatever information I find about the other problem.

Actually my code looks like this:

 private:    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "My Mesh", meta = (AllowPrivateAccess = "true"))
    	UStaticMeshComponent* MeshComp;
    
    	UPROPERTY(EditDefaultsOnly, Category = "Trigger")
    	float Delay;
    
    	UPROPERTY(EditDefaultsOnly, Category = "My Mesh") 
    	UStaticMesh* MyMesh;

So yes, there IS the meta

You can’t omit information and expect me to know :), anyway I’ll continue looking into this as I said.

Hey ,

After looking into the functionality of VisibleAnywhere, I’ve entered a bug report for the fact that you are still able to edit the properties of a Component when it is marked with that specifier. You can find the bug report here: UE-51397

Have a nice day!

Hi, I am able to reproduce this error as it is still not fixed in 4.18. I have 2 components set as visibleanywhere but they are still able to be edited.

Pretty frustrating when you think you’re doing something wrong, spend hours of research only to find it as a bug.