AActor::GetActorRotation

Returns the rotation of the RootComponent of this Actor

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h

Include

#include "GameFramework/Actor.h"

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);  
}
Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback