Advertisement
Guest User

Untitled

a guest
Apr 6th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.59 KB | None | 0 0
  1. #include "MainCar.h"
  2. #include "GameFrameWork/SpringArmComponent.h"
  3. #include "Camera/CameraComponent.h"
  4. #include "DrawDebugHelpers.h"
  5. #include "InputMappingContext.h"
  6. #include "EnhancedInputSubsystems.h"
  7. #include "EnhancedInputComponent.h"
  8. #include "Kismet/GameplayStatics.h"
  9.  
  10. AMainCar::AMainCar()
  11. {
  12. CarMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("CarMesh"));
  13. FlameTrailMeshL = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("FlameTrailMeshL"));
  14. FlameTrailMeshR = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("FlameTrailMeshR"));
  15. CameraC = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
  16. LineTraceParent = CreateDefaultSubobject<USceneComponent>(TEXT("LinetraceParent"));
  17. CenterLineTrace = CreateDefaultSubobject<USceneComponent>(TEXT("CenterStartScene"));
  18. CenterLineTraceEnd = CreateDefaultSubobject<USceneComponent>(TEXT("CenterEndLineTrace"));
  19.  
  20. AutoPossessPlayer = EAutoReceiveInput::Player0;
  21.  
  22. RootComponent = CarMesh;
  23.  
  24. FlameTrailMeshL->SetupAttachment(CarMesh);
  25. FlameTrailMeshR->SetupAttachment(CarMesh);
  26.  
  27. LineTraceParent->SetupAttachment(CarMesh);
  28.  
  29. CenterLineTrace->SetupAttachment(LineTraceParent);
  30. CenterLineTrace->SetWorldLocation(GetActorLocation() + FVector(0, 0, LinetraceStartHeight));
  31.  
  32. CenterLineTraceEnd->SetupAttachment(LineTraceParent);
  33. CenterLineTraceEnd->SetWorldLocation(GetActorLocation() + FVector(0, 0, LinetraceEndHeight));
  34. }
  35.  
  36. void AMainCar::BeginPlay()
  37. {
  38. Super::BeginPlay();
  39.  
  40. UInputMappingContext* InputContext_Asset = LoadObject<UInputMappingContext>(nullptr, TEXT("InputMappingContext'/Game/Scripts/Input/Car_Input_Context.Car_Input_Context'"));
  41. UInputAction* MoveBackwards_Asset = LoadObject<UInputAction>(nullptr, TEXT("InputAction'/Game/Scripts/Input/S.S'"));
  42. UInputAction* Boost_Asset = LoadObject<UInputAction>(nullptr, TEXT("InputAction'/Game/Scripts/Input/Boost.Boost'"));
  43. UInputAction* W_Asset = LoadObject<UInputAction>(nullptr, TEXT("InputAction'/Game/Scripts/Input/W.W'"));
  44. UInputAction* A_Asset = LoadObject<UInputAction>(nullptr, TEXT("InputAction'/Game/Scripts/Input/A.A'"));
  45. UInputAction* D_Asset = LoadObject<UInputAction>(nullptr, TEXT("InputAction'/Game/Scripts/Input/D.D'"));
  46. UInputAction* Esc_Asset = LoadObject<UInputAction>(nullptr, TEXT("InputAction'/Game/Scripts/Input/Esc.Esc'"));
  47.  
  48. UTexture2D* emptyBoostBar_Asset = LoadObject<UTexture2D>(nullptr, TEXT("Texture2D'/Game/UI/Images/BoostBarEmpty.BoostBarEmpty'"));
  49. UTexture2D* BoostBar_Asset = LoadObject<UTexture2D>(nullptr, TEXT("Texture2D'/Game/UI/Images/BoostBar.BoostBar'"));
  50.  
  51. TSubclassOf<UIngameUI> UI_Asset = StaticLoadClass(UUserWidget::StaticClass(), nullptr, TEXT("WidgetBlueprint'/Game/Scripts/UI/IngameUI.IngameUI_C'"));
  52.  
  53. PlayerHUDClass = UI_Asset;
  54.  
  55. InputMapping = InputContext_Asset;
  56. MoveBackwards = MoveBackwards_Asset;
  57. PressBoost = Boost_Asset;
  58. MoveForwards = W_Asset;
  59. SteerLeftAction = A_Asset;
  60. SteerRightAction = D_Asset;
  61. PauseGame = Esc_Asset;
  62.  
  63. BoostBarFilled = BoostBar_Asset;
  64. BoostBarEmpty = emptyBoostBar_Asset;
  65.  
  66. CarMesh->SetLinearDamping(3.0f);
  67. CarMesh->SetAngularDamping(5.0f);
  68. CarMesh->SetAllUseCCD(true);
  69.  
  70. CurrentBoost = 100;
  71. MaxBoost = 100;
  72. PrimaryActorTick.bCanEverTick = true;
  73.  
  74. CarMesh->SetEnableGravity(false);
  75. CarMesh->SetSimulatePhysics(true);
  76.  
  77. CameraC->SetFieldOfView(100);
  78. CameraC->SetRelativeLocation(FVector(-600, 0, 140));
  79. CameraC->SetRelativeRotation(FRotator(-6, 0, 0));
  80.  
  81. if (IsLocallyControlled() && PlayerHUDClass)
  82. {
  83. PlayerHUD = CreateWidget<UIngameUI>(GetWorld(), PlayerHUDClass);
  84. check(PlayerHUD);
  85. PlayerHUD->AddToPlayerScreen();
  86. }
  87. }
  88.  
  89. void AMainCar::EndPlay(const EEndPlayReason::Type EndPlayReason)
  90. {
  91. if (PlayerHUD)
  92. {
  93. PlayerHUD->RemoveFromParent();
  94. PlayerHUD = nullptr;
  95. }
  96.  
  97. Super::EndPlay(EndPlayReason);
  98. }
  99.  
  100. void AMainCar::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
  101. {
  102. Super::SetupPlayerInputComponent(PlayerInputComponent);
  103.  
  104. if (APlayerController* PlayerController = Cast<APlayerController>(Controller))
  105. {
  106. if (UEnhancedInputLocalPlayerSubsystem* subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()))
  107. {
  108. subsystem->AddMappingContext(InputMapping, 0);
  109. }
  110. }
  111.  
  112. if (UEnhancedInputComponent* Input = CastChecked<UEnhancedInputComponent>(PlayerInputComponent))
  113. {
  114. Input->BindAction(PressBoost, ETriggerEvent::Triggered, this, &AMainCar::Boosting);
  115. Input->BindAction(PressBoost, ETriggerEvent::Completed, this, &AMainCar::StopBoosting);
  116.  
  117. Input->BindAction(MoveForwards, ETriggerEvent::Triggered, this, &AMainCar::Accelerate);
  118. Input->BindAction(MoveForwards, ETriggerEvent::Completed, this, &AMainCar::StopAccelerate);
  119.  
  120. Input->BindAction(SteerLeftAction, ETriggerEvent::Started, this, &AMainCar::SteerLeftPressed);
  121. Input->BindAction(SteerLeftAction, ETriggerEvent::Completed, this, &AMainCar::SteerLeftReleased);
  122.  
  123. Input->BindAction(SteerRightAction, ETriggerEvent::Started, this, &AMainCar::SteerRightPressed);
  124. Input->BindAction(SteerRightAction, ETriggerEvent::Completed, this, &AMainCar::SteerRightReleased);
  125.  
  126. Input->BindAction(MoveBackwards, ETriggerEvent::Triggered, this, &AMainCar::Deccelerate);
  127. Input->BindAction(MoveBackwards, ETriggerEvent::Completed, this, &AMainCar::StopDeccelerating);
  128.  
  129. Input->BindAction(PauseGame, ETriggerEvent::Triggered, this, &AMainCar::PauseGameState);
  130. }
  131. }
  132.  
  133. void AMainCar::CameraMovement(float DeltaTime)
  134. {
  135. FVector CarPosition = GetActorLocation();
  136.  
  137. FVector SurfaceTraceStart = CarPosition;
  138. FVector SurfaceTraceEnd = CarPosition - GetActorUpVector() * 500.0f;
  139.  
  140. FHitResult SurfaceHit;
  141. FCollisionQueryParams Params;
  142. Params.AddIgnoredActor(this);
  143. Params.bTraceComplex = true;
  144.  
  145. FVector SurfaceNormal = FVector::UpVector;
  146. if (GetWorld()->LineTraceSingleByChannel(SurfaceHit, SurfaceTraceStart, SurfaceTraceEnd, ECC_Visibility, Params))
  147. {
  148. SurfaceNormal = SurfaceHit.ImpactNormal;
  149. }
  150.  
  151. FVector ForwardProjected = FVector::VectorPlaneProject(GetActorForwardVector(), SurfaceNormal).GetSafeNormal();
  152. FRotator SurfaceAlignedRotation = FRotationMatrix::MakeFromXZ(ForwardProjected, SurfaceNormal).Rotator();
  153.  
  154. SurfaceAlignedRotation.Pitch = FMath::ClampAngle(SurfaceAlignedRotation.Pitch + CameraPitchOffset, -80, 80);
  155.  
  156. FRotator DesiredCameraRotation = FMath::RInterpTo(CameraC->GetComponentRotation(), SurfaceAlignedRotation, DeltaTime, CameraInterpSpeedRotation);
  157.  
  158. CameraC->SetWorldRotation(DesiredCameraRotation);
  159.  
  160. FVector CameraOffset = DesiredCameraRotation.RotateVector(FVector(-CameraFollowDistance, 0, CameraHeight));
  161. FVector DesiredCameraWorldPos = CarPosition + CameraOffset;
  162. FVector InterpolatedCameraPosition = FMath::VInterpTo(CameraC->GetComponentLocation(), DesiredCameraWorldPos, DeltaTime, CameraInterpSpeedLocation);
  163.  
  164. CameraC->SetWorldLocation(InterpolatedCameraPosition);
  165.  
  166. FVector CurrentVelocity = CarMesh->GetComponentVelocity();
  167. float CurrentSpeed = CurrentVelocity.Size();
  168. float SpeedRatio = FMath::Clamp(CurrentSpeed / MaxSpeedForClamp, 0.0f, 1.0f);
  169. float DesiredFOV = FMath::Lerp(BaseFOV, MaxFOV, SpeedRatio);
  170. float CurrentFOV = CameraC->FieldOfView;
  171. float NewFOV = FMath::FInterpTo(CurrentFOV, DesiredFOV, DeltaTime, FOVInterpSpeed);
  172. CameraC->SetFieldOfView(NewFOV);
  173. }
  174.  
  175. void AMainCar::UpdateThrottle(float DeltaTime)
  176. {
  177. CurrentThrottle = FMath::FInterpTo(CurrentThrottle, TargetThrottle, DeltaTime, AccelerationSpeed);
  178.  
  179. FVector CurrentVelocity = CarMesh->GetComponentVelocity();
  180. FVector ForwardVector = FVector::VectorPlaneProject(GetActorForwardVector(), GetActorUpVector()).GetSafeNormal();
  181. if (ForwardVector.IsNearlyZero())
  182. ForwardVector = GetActorForwardVector();
  183.  
  184. float ForwardSpeed = FVector::DotProduct(CurrentVelocity, ForwardVector);
  185.  
  186. FVector AppliedForce = FVector::ZeroVector;
  187.  
  188. if (FMath::Abs(CurrentThrottle) > KINDA_SMALL_NUMBER)
  189. {
  190. if (CurrentThrottle > 0.f)
  191. {
  192. AppliedForce = ForwardVector * CurrentThrottle * EngineForceCoefficient;
  193. }
  194. else if (CurrentThrottle < 0.f)
  195. {
  196. if (ForwardSpeed > 10.f)
  197. {
  198. AppliedForce = -ForwardVector * BrakeForceCoefficient * FMath::Abs(CurrentThrottle);
  199. }
  200. else
  201. {
  202. AppliedForce = ForwardVector * CurrentThrottle * (EngineForceCoefficient * 0.8f);
  203. }
  204. }
  205.  
  206. if (!AppliedForce.ContainsNaN() && !AppliedForce.IsNearlyZero())
  207. UE_LOG(LogTemp, Log, TEXT("AppliedForce: X=%f, Y=%f, Z=%f"), AppliedForce.X, AppliedForce.Y, AppliedForce.Z);
  208.  
  209. CarMesh->AddForce(AppliedForce, NAME_None, true);
  210. }
  211.  
  212. CarMesh->SetLinearDamping(CurrentThrottle < 0.f ? 8.0f : 3.0f);
  213.  
  214. //set flame mesh scale based on speed
  215. float CurrentSpeed = CurrentVelocity.Size();
  216. float SpeedRatio = FMath::Clamp(CurrentSpeed / MaxSpeedForClamp, 0.0f, 1.0f);
  217. float DesiredScale = FMath::Lerp(MinFlameScale, MaxFlameScale, SpeedRatio);
  218.  
  219. //setting the spedometer slider
  220. float SpedometerSpeedRatio = FMath::Clamp(CurrentSpeed / (MaxSpeedForClamp * 2), 0.0f, 1.0f);
  221. PlayerHUD->SetSpedometer(SpedometerSpeedRatio);
  222.  
  223. if (SpedometerSpeedRatio > 0.2f)
  224. {
  225. CameraFollowDistance = FMath::FInterpTo(CameraFollowDistance, 200.0f, DeltaTime, 2);
  226. }
  227. else
  228. {
  229. CameraFollowDistance = FMath::FInterpTo(CameraFollowDistance, 400.0f, DeltaTime, 2);
  230. }
  231.  
  232. float CurrentXScaleL = FlameTrailMeshL->GetRelativeScale3D().X;
  233. float NewXScaleL = FMath::FInterpTo(CurrentXScaleL, DesiredScale, DeltaTime, ScaleInterpSpeed);
  234. FlameTrailMeshL->SetRelativeScale3D(FVector(NewXScaleL, -1.0f, 1.0f));
  235.  
  236. float CurrentXScaleR = FlameTrailMeshR->GetRelativeScale3D().X;
  237. float NewXScaleR = FMath::FInterpTo(CurrentXScaleR, DesiredScale, DeltaTime, ScaleInterpSpeed);
  238. FlameTrailMeshR->SetRelativeScale3D(FVector(NewXScaleR, 1.0f, 1.0f));
  239. }
  240.  
  241. void AMainCar::Tick(float DeltaTime)
  242. {
  243. Super::Tick(DeltaTime);
  244.  
  245. //checks if there even is a car mesh and if its simulating physics if not then dont execute void to prevent engine crash
  246. if (!CarMesh || !CarMesh->IsSimulatingPhysics() || !FlameTrailMeshL || !FlameTrailMeshR)
  247. {
  248. return;
  249. }
  250.  
  251. UpdateBoost(DeltaTime);
  252. CameraMovement(DeltaTime);
  253. UpdateThrottle(DeltaTime);
  254.  
  255. FVector traceStart = CenterLineTrace->GetComponentLocation();
  256. FVector traceEnd = CenterLineTraceEnd->GetComponentLocation();
  257. FHitResult Hit;
  258.  
  259. FCollisionQueryParams Params;
  260. Params.AddIgnoredActor(this);
  261. Params.bTraceComplex = true;
  262.  
  263. FCollisionObjectQueryParams ObjectQueryParams;
  264. ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldStatic);
  265.  
  266. if (GetWorld()->LineTraceSingleByObjectType(Hit, traceStart, traceEnd, ObjectQueryParams, Params))
  267. {
  268. if (Hit.GetActor() && Hit.GetActor()->ActorHasTag("Track") && !Hit.GetActor()->ActorHasTag("Wall"))
  269. {
  270. float UpDot = FVector::DotProduct(Hit.ImpactNormal, FVector::UpVector);
  271. float SteepThreshold = 0.7f;
  272. bool bSteepSurface = UpDot < SteepThreshold;
  273.  
  274. FVector ForwardVector = FVector::VectorPlaneProject(GetActorForwardVector(), Hit.ImpactNormal).GetSafeNormal();
  275. FQuat BaseQuat = FRotationMatrix::MakeFromXZ(ForwardVector, Hit.ImpactNormal).ToQuat();
  276.  
  277. float BlendFactor = bSteepSurface ? 1.0f : UpDot;
  278. float AdjustedRollAngle = SteeringInput * 0 * BlendFactor;
  279. FQuat RollQuat = FQuat(ForwardVector, FMath::DegreesToRadians(AdjustedRollAngle));
  280.  
  281. FQuat DesiredQuat = RollQuat * BaseQuat;
  282. FQuat NewQuat = FQuat::Slerp(GetActorQuat(), DesiredQuat, DeltaTime * RotationInterpSpeed);
  283. SetActorRotation(NewQuat);
  284.  
  285. if (!bSteepSurface)
  286. {
  287. FVector DesiredPosition = Hit.ImpactPoint + Hit.ImpactNormal * DesiredHoverHeight;
  288. FVector NewPosition = FMath::VInterpTo(GetActorLocation(), DesiredPosition, DeltaTime, HoverInterpSpeed);
  289. SetActorLocation(NewPosition, true);
  290. }
  291. else
  292. {
  293. FVector CurrentLocation = GetActorLocation();
  294. FVector WallNormal = Hit.ImpactNormal;
  295. FVector ProjectedLocation = CurrentLocation - FVector::DotProduct(CurrentLocation - Hit.ImpactPoint, WallNormal) * WallNormal;
  296. FVector DesiredPosition = ProjectedLocation + WallNormal * DesiredHoverHeight;
  297. FVector NewPosition = FMath::VInterpTo(CurrentLocation, DesiredPosition, DeltaTime, HoverInterpSpeed);
  298. SetActorLocation(NewPosition, true);
  299. }
  300. }
  301. }
  302.  
  303. //DrawDebugLine(GetWorld(), traceStart, traceEnd, FColor::Blue, false, 0.1f, 0, 1.0f);
  304.  
  305. if (steerLeft && !steerRight)
  306. {
  307. SteeringInput = -1.0f;
  308. }
  309. else if (steerRight && !steerLeft)
  310. {
  311. SteeringInput = 1.0f;
  312. }
  313. else
  314. {
  315. SteeringInput = 0.0f;
  316. }
  317.  
  318. FVector currentAngularVelocity = CarMesh->GetPhysicsAngularVelocityInDegrees();
  319.  
  320. if (FMath::Abs(SteeringInput) > 0.1f)
  321. {
  322. if (FMath::Abs(currentAngularVelocity.Z) < MaxSteeringAngularVelocity)
  323. {
  324. FVector SteeringTorque = GetActorUpVector() * SteeringInput * SteeringTorqueCoefficient;
  325. CarMesh->AddTorqueInRadians(SteeringTorque, NAME_None, true);
  326. }
  327. }
  328.  
  329. if (currentAngularVelocity.Size() > 0.1f && FMath::Abs(SteeringInput) < 0.1f)
  330. {
  331. FVector brakingTorque = -currentAngularVelocity.GetSafeNormal() * BrakingTorqueConstant;
  332. CarMesh->AddTorqueInDegrees(brakingTorque, NAME_None, true);
  333. }
  334.  
  335. if (bBraking)
  336. {
  337. FVector CurrentVelocity = CarMesh->GetComponentVelocity();
  338. float CurrentSpeed = CurrentVelocity.Size();
  339.  
  340. if (CurrentSpeed > KINDA_SMALL_NUMBER)
  341. {
  342. FVector BrakeDirection = -CurrentVelocity.GetSafeNormal();
  343.  
  344. float BrakeStrength = FMath::Clamp(CurrentSpeed / 500.f, 0.f, 1.f);
  345. FVector BrakeForce = BrakeDirection * ReverseForceCoefficient * BrakeStrength;
  346.  
  347. CarMesh->AddForce(BrakeForce, NAME_None, true);
  348. }
  349. }
  350. else
  351. {
  352. CarMesh->SetLinearDamping(CurrentThrottle < 0.f ? 8.0f : 3.0f);
  353. }
  354.  
  355. if (bIsTimerRunning)
  356. {
  357. CurrentLaptimeFloat += DeltaTime;
  358.  
  359. PlayerHUD->SetCurrentLaptime(GetFormattedTime());
  360. }
  361.  
  362. FVector Velocity = CarMesh->GetPhysicsLinearVelocity();
  363.  
  364. FVector Forward = GetActorForwardVector().GetSafeNormal();
  365. FVector Side = FVector::VectorPlaneProject(Velocity, Forward);
  366.  
  367. FVector Dampened = Velocity - Side * FMath::Clamp(5 * DeltaTime, 0.f, 1.f);
  368. CarMesh->SetPhysicsLinearVelocity(Dampened);
  369. }
  370.  
  371. FText AMainCar::GetFormattedTime() const
  372. {
  373. int32 TotalMilliseconds = FMath::FloorToInt(CurrentLaptimeFloat * 1000.f);
  374.  
  375. int32 Minutes = TotalMilliseconds / (60 * 1000);
  376. int32 Seconds = (TotalMilliseconds % (60 * 1000)) / 1000;
  377. int32 Milliseconds = TotalMilliseconds % 1000;
  378.  
  379. FString Formatted = FString::Printf(TEXT("%d.%02d.%03d"), Minutes, Seconds, Milliseconds);
  380. return FText::FromString(Formatted);
  381. }
  382.  
  383.  
  384. void AMainCar::Boosting(const FInputActionValue& Value)
  385. {
  386. bIsBoosting = (CurrentBoost > 0);
  387. }
  388.  
  389. void AMainCar::StopBoosting(const FInputActionValue& Value)
  390. {
  391. bIsBoosting = false;
  392. }
  393.  
  394. void AMainCar::UpdateBoost(float DeltaTime)
  395. {
  396. if (bIsBoosting && CurrentBoost > 0.0f && TargetThrottle > 0 && !bIsRecharging)
  397. {
  398. PlayerHUD->SetFillImage(BoostBarFilled);
  399.  
  400. MaxFOV = 150;
  401. MaxFlameScale = 1.6f;
  402.  
  403. FVector BoostForce = GetActorForwardVector() * BoostForceCoefficient;
  404. CarMesh->AddForce(BoostForce, NAME_None, true);
  405.  
  406. CurrentBoost -= BoostDrainRate * DeltaTime;
  407. CurrentBoost = FMath::Clamp(CurrentBoost, 0.0f, MaxBoost);
  408.  
  409. if (CurrentBoost <= 0.0f)
  410. {
  411. PlayerHUD->SetFillImage(BoostBarEmpty);
  412.  
  413. bIsRecharging = true;
  414. bIsBoosting = false;
  415.  
  416. MaxFOV = 140;
  417. MaxFlameScale = 1;
  418. }
  419. }
  420. else
  421. {
  422. MaxFOV = 140;
  423. MaxFlameScale = 1;
  424.  
  425. CurrentBoost += BoostRechargeRate * DeltaTime;
  426. CurrentBoost = FMath::Clamp(CurrentBoost, 0.0f, MaxBoost);
  427.  
  428. if (CurrentBoost >= MaxBoost / 2 && bIsRecharging)
  429. {
  430. bIsRecharging = false;
  431. PlayerHUD->SetFillImage(BoostBarFilled);
  432. }
  433. }
  434.  
  435. if (PlayerHUD && PlayerHUD->IsInViewport())
  436. {
  437. PlayerHUD->SetBoost(CurrentBoost, MaxBoost);
  438. }
  439. }
  440.  
  441. void AMainCar::Accelerate(const FInputActionValue& Value)
  442. {
  443. TargetThrottle = FMath::Clamp(Value.Get<float>(), 0.0f, 1.0f);
  444. }
  445.  
  446. void AMainCar::StopAccelerate(const FInputActionValue& Value)
  447. {
  448. TargetThrottle = 0.0f;
  449. }
  450.  
  451. void AMainCar::SteerLeftPressed()
  452. {
  453. steerLeft = true;
  454. }
  455.  
  456. void AMainCar::SteerLeftReleased()
  457. {
  458. steerLeft = false;
  459. }
  460.  
  461. void AMainCar::SteerRightPressed()
  462. {
  463. steerRight = true;
  464. }
  465.  
  466. void AMainCar::SteerRightReleased()
  467. {
  468. steerRight = false;
  469. }
  470.  
  471.  
  472. void AMainCar::Deccelerate()
  473. {
  474. bBraking = true;
  475. }
  476.  
  477. void AMainCar::StopDeccelerating()
  478. {
  479. bBraking = false;
  480. }
  481.  
  482. void AMainCar::PauseGameState()
  483. {
  484. UGameplayStatics::SetGamePaused(GetWorld(), true);
  485. PlayerHUD->EnableUI();
  486. }
  487.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement