Why use UPROPERTY(EditAnywhere)?

I was able to follow along with the video and compile successfully.

I’m just not sure what I just learned to do :sweat_smile:

What does the compiler tell Unreal when I use UPROPERTY(EditAnywhere)? Will I use this same code every time I want to make a variable? Maybe this will be covered in a later module, so I will continue on, but I’m just trying to have a full understanding…

The UPROPERTY let’s you expose the variable to the Blueprint and instance so you can adjust the values without changing the code. EditAnywhere means it can me adjusted on the Blueprint and also on the instance. There’s different values you can use later, some of which will be covered in the course.

Not all variables should be set up this way, only those that you may need to change when setting up and configuring for the game.

I hope this helps.

1 Like

Thank you, that is very helpful. :hugs:

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

Privacy & Terms