UPROPERTY Flashcards

(7 cards)

1
Q

what are the specifiers for a UPROPERTY?

A
first = visibility or editability
second = BP accessibility 
third = categories

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= BallBearing)
UStaticMeshComponent* ballMesh;

you can only just one of each

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what specifiers do visibility and editability have?

A

They decide whether the class can just see it, or can edit it in BP.

EditAnywhere - property can be edited on archetypes and instances
EditDefaultsOnly = only on archetypes, not on instances
EditInstanceOnly = only on instances, not on archetypes
VisibleAnywhere = visible but cannot be edited
VisibleDefaultsOnly = visible for archetypes, not for instances, cannot be edited
VisibleInstanceOnly = visible for instances, not archetypes, cannot be edited

EditAnywhere and VisibleAnywhere are most likely

Edit and Visibility modifiers CANNOT be used together

You can only specify one per UPROPERTY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is an archetype and what is an instance?

A
archetype = classes and BPS
instances = literal instances of archetypes in the level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the specifiers for accessibility?

A
BlueprintReadOnly = can be read by blueprints, but not modified
BlueprintReadWrite = can be read or written from a BP

Limit BP access where possible, for maintenence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is “Transient”?

A

Transient = keyword next to UPROPERTY that has a pointer pointing to a class derived UObject but doesnt access BP in anywhere

it just means its a temporary property - its a smart pointer that’ll delete on its own.

UPROPERTY(Transient)
UParticleSystemComponent* Sprinkles;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is the ‘meta’ specifier?

A

control how classes, interfaces, structs, enums and values can behave in different sections of the engine or editor

meta = (AllowPrivateAccess = “true”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a UPROPERTY()?

A

C++ Macro

Part of the UE Reflection system

Allows BP to edit values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly