Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/GameFramework > API/Runtime/Engine/GameFramework/AActor
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h |
| Include | #include "GameFramework/Actor.h" |
FRotator GetActorRotation&40;&41; const
Remarks
Returns the rotation of the RootComponent of this Actor
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);
}