Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UGameplayStatics
Description
Transforms a world space location into "first person space". This function mirrors the morphing that is applied to first person primitives when they are rendered on the GPU, so it can be used for spawning objects (e.g. projectiles or ejected shell casings) relative to the morphed first person geometry on screen.
| Name | TransformWorldToFirstPerson |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h |
| Include Path | #include "Kismet/GameplayStatics.h" |
| Source | /Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp |
UFUNCTION (BlueprintPure, Category="Camera")
static FVector TransformWorldToFirstPerson
(
const FMinimalViewInfo & ViewInfo,
const FVector & WorldPosition,
bool bIgnoreFirstPersonScale
)
Parameters
| Name | Remarks |
|---|---|
| ViewInfo | FMinimalViewInfo struct holding the first person camera parameters. |
| WorldPosition | World space position to transform. |
| bIgnoreFirstPersonScale | Ignores the scaling that is applied to first person primitives which can be useful when spawning full size world space projectiles relative to a first person weapon. |