Uproperty VisibleAnyere for UProjectileMovementComponent

I thought the UProperty VisibleAnywhere was supposed to make the setting readonly from the blueprint outliner.
How is it that we able to edit it from the Blueprint editor?

Also, I had great trouble getting the projectile moving, only to find that I hadn’t moved the projectile spawn point far enough from the tank to stop the projectile registering a block collision on spawn.
If anyone is having a similar issue, I suggest moving your spawn point a tank width away from the tank turret and test. Once you’ve confirmed the projectile is moving , edit the blueprint again and move the spawn point nearer to the Turret leaving a projectile length gap between the spawn point and the turret.

It’s not blueprint that it’s being exposed to. It’s the property editor within Unreal. This shows up in blueprint and on instances in the details panel. You can’t access it from the Event Graph in blueprint.

VisibleAnywhere makes properties on the component visible whether they are editable or not.

class USomeActorComponent : public UActorComponent
{
    // ...
    UPROPERTY(VisibleAnywhere)
    int32 VisibleOnly = 1;
    UPROPERTY(EditAnywhere)
    int32 Editable = 2;
    int32 NotSeen = 3;
};


class ASomeActor : public AActor
{
    // ...
    UPROPERTY(VisibleAnywhere)
    USomeActorComponent* ActorComp;
};

With this sample, when you select ActorComp, in the details panel you will see VisibleOnly and will be unable to edit it, Editable will be editable, and NotSeen won’t show up. You will not be able to access any of them within the event graph.

If you remove UPROPERTY(VisibleAnywhere) from ActorComp you won’t see any of them.

Yes thats what I thought, I’ve found my issue.
For course context , BP_Projectile is derived from the C++ Class Projectile and that is used to be spawned from the Tank and Turret.
When I said blueprint outliner, I wasn’t referring to the Eventgraph, but was describing editing the Blueprint BP_Projectile from the details panel that appears when you edit a blueprint.

It turns out the problem I was having was just a coincidence caused by me using the same category name as the UProjectileMovementComponent I added in code:

In the class header for the Projectile class, I added the following:

UPROPERTY(VisibleAnywhere,Category="Projectile")
class UProjectileMovementComponent* MoveProjectile;

What I didn’t realise, is that UProjectileMovementComponent adds its own Projectile category in the details panel so its properties can be set from there, I was confusing my Projectile category with that one which is why I was seeing values being editable.

image

I’ve changed my category to something else so all is ok now.
It is a shame that the Unreal engine can’t change the colour of your own custom UProperty settings so they can be clearly seen to be different to the ones that built in to the ones the components add.

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

Privacy & Terms