Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ASpaceFlightPawn::Tick(float DeltaSeconds)
- {
- const FVector LocalMove = FVector(CurrentForwardSpeed * DeltaSeconds, 0.f, 0.f);
- // Move plan forwards (with sweep so we stop when we collide with things)
- AddActorLocalOffset(LocalMove, true);
- // Calculate change in rotation this frame
- FRotator DeltaRotation(0,0,0);
- DeltaRotation.Pitch = CurrentPitchSpeed * DeltaSeconds;
- DeltaRotation.Yaw = CurrentYawSpeed * DeltaSeconds;
- DeltaRotation.Roll = CurrentRollSpeed * DeltaSeconds;
- // Rotate plane
- AddActorLocalRotation(DeltaRotation);
- // Call any parent class Tick implementation
- Super::Tick(DeltaSeconds);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement