Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/AActor
Description
Returns the rotation of the RootComponent of this Actor
| Name | GetActorRotation |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h |
| Include Path | #include "GameFramework/Actor.h" |
FRotator GetActorRotation() const
Example Code
ShooterProjectile.cpp at line 145:
void AShooterProjectile::OnRep_Exploded()
{
FVector ProjDirection = GetActorForwardVector();
const FVector StartTrace = GetActorLocation() - ProjDirection 200;
const FVector EndTrace = GetActorLocation() + ProjDirection 150;
FHitResult Impact;
if (!GetWorld()->LineTraceSingleByChannel(Impact, StartTrace, EndTrace, COLLISION_PROJECTILE, FCollisionQueryParams(SCENE_QUERY_STAT(ProjClient), true, GetInstigator())))
{
// failsafe
Impact.ImpactPoint = GetActorLocation();
Impact.ImpactNormal = -ProjDirection;
}
Explode(Impact);
}