Unreal Engine 5.0
Unreal Engine 4.27
Unreal Engine 5.0
Unreal Engine 4.27
A Gameplay Location is a structure that contains a gameplay tag and a weak pointer to an object implementing IGameplayLocationQuerier
. It represents a generic 'description' to a location that can dynamically be resolved (on-demand) on the context object it carries.
You would usually resort to using Gameplay Locations when just the idea of a location means more than the actual FVector
coordinate itself.
Whether instances of a class implementing IGameplayLocationQuerier
resolve a certain tag is determined at compile-time. See UGameplayLocationSettings
.
You can resolve the tag of FGameplayLocation
by calling Get()
, which returns an FVector
.
The structure also supports implicit conversion to FVector
, which is the same as calling Get()
.
Refrain from caching the return value beyond its current scope, and always resolve this on-demand instead.
Unless you want serialization, it is not necessary to mark your Gameplay Location class member with UPROPERTY
, as FGameplayLocation
uses TWeakObjectPtr
internally, which will always return nullptr
if the object underneath was destroyed.
Unreal Engine 5.0
Unreal Engine 4.27