Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. void ASpaceFlightPawn::Tick(float DeltaSeconds)
  2. {
  3.     const FVector LocalMove = FVector(CurrentForwardSpeed * DeltaSeconds, 0.f, 0.f);
  4.  
  5.     // Move plan forwards (with sweep so we stop when we collide with things)
  6.     AddActorLocalOffset(LocalMove, true);
  7.  
  8.     // Calculate change in rotation this frame
  9.     FRotator DeltaRotation(0,0,0);
  10.     DeltaRotation.Pitch = CurrentPitchSpeed * DeltaSeconds;
  11.     DeltaRotation.Yaw = CurrentYawSpeed * DeltaSeconds;
  12.     DeltaRotation.Roll = CurrentRollSpeed * DeltaSeconds;
  13.  
  14.     // Rotate plane
  15.     AddActorLocalRotation(DeltaRotation);
  16.  
  17.     // Call any parent class Tick implementation
  18.     Super::Tick(DeltaSeconds);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement