AActor::GetActorRotation

Syntax

FRotator GetActorRotation() const

Remarks

Returns the rotation of the RootComponent of this Actor

Example Code

ShooterProjectile.cpp at line 118:

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, Instigator)))  
    {  
        // failsafe  
        Impact.ImpactPoint = GetActorLocation();  
        Impact.ImpactNormal = -ProjDirection;  
    }  

    Explode(Impact);  
}

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/Actor.h