Shouldn't the SceneComponent properties not be editable?

Maybe I’m misunderstanding but both the VisibleAnywhere and BlueprintReadOnly are read only specifiers correct? So how come we can edit them in the blueprint editor?

1 Like

Component’s are a little different with that. VisibleAnywhere will make the properties on the component to be visible; whether they are editable or not. You aren’t editing the component variable itself (i.e. Comp's address in the code below)

For example:

class MyComponent : public UActorComponent
{
//..
    UPROPERTY(EditAnywhere)
    int32 EditableInt;
    UPROPERTY(VisibleAnywhere)
    int32 VisibleInt;
    int32 NonVisibleInt;
};

class AMyActor : public AActor
{
//..
    UPROPERTY(VisibleAnywhere)
    UMyComponent* Comp; // will show EditableInt as editable,
                        // VisibleInt as read only,
                        // NonVisibleInt won't be listed
};

Also the Blueprint specifiers are for blueprint code access specifically, not the properties editor within the blueprint.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms