Implemented Calling Bike Func
This commit is contained in:
		
							parent
							
								
									6af27aa2a6
								
							
						
					
					
						commit
						b4fcc23c50
					
				
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Input/Actions/IA_Interact.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Ships/BP_SpaceShip.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Ships/BP_SpaceShip.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										2
									
								
								EndlessVendetta/EndlessVendetta.sln.DotSettings.user
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								EndlessVendetta/EndlessVendetta.sln.DotSettings.user
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | ||||
| <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||||
| 	<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\Rafal\AppData\Local\JetBrains\Rider2023.3\resharper-host\temp\Rider\vAny\CoverageData\_EndlessVendetta.-1253833435\Snapshot\snapshot.utdcvr</s:String></wpf:ResourceDictionary> | ||||
| @ -215,12 +215,13 @@ void AEndlessVendettaCharacter::SetupPlayerInputComponent(class UInputComponent* | ||||
| 
 | ||||
| 		//Interacting
 | ||||
| 		EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Started, this, &AEndlessVendettaCharacter::Interact); | ||||
| 		EnhancedInputComponent->BindAction(InteractAction, ETriggerEvent::Triggered, this, &AEndlessVendettaCharacter::HoldInteract); | ||||
| 	} | ||||
| 	UE_LOG(LogTemp, Warning, TEXT("Setup player input on EV character")); | ||||
| } | ||||
| 
 | ||||
| void AEndlessVendettaCharacter::Interact() | ||||
| { | ||||
| 	UE_LOG(LogTemp, Warning, TEXT("Interaction Has Been Called")); | ||||
| 	if (InPauseMenu) return; | ||||
| 	if (bIsInDialogue) | ||||
| 	{ | ||||
| @ -740,12 +741,25 @@ void AEndlessVendettaCharacter::UpdateInventorySize(int Cols, int Rows) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void AEndlessVendettaCharacter::HoldInteract() | ||||
| { | ||||
| 	if (PlayerOnShip || InPauseMenu) return; | ||||
| 	FTransform TakeOffTransform = GetActorTransform(); | ||||
| 	FVector NewLoc = TakeOffTransform.GetLocation(); | ||||
| 	NewLoc.Z += BikeRideHeight; | ||||
| 	TakeOffTransform.SetLocation(NewLoc); | ||||
| 	EnterShip(TakeOffTransform); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| void AEndlessVendettaCharacter::EnterShip(FTransform TakeoffLoc) | ||||
| { | ||||
| 	PlayFadeScreen(); | ||||
| 	if (IsValid(PrimaryWeapon)) EquipPrimary(); | ||||
| 	if (IsValid(SecondaryWeapon)) EquipSecondary(); | ||||
| 	SpaceShip = GetWorld()->SpawnActor<ASpaceShip>(SpaceShipClass, TakeoffLoc.GetLocation(), TakeoffLoc.Rotator()); | ||||
| 	FActorSpawnParameters SpawnParams; | ||||
| 	SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn; | ||||
| 	SpaceShip = GetWorld()->SpawnActor<ASpaceShip>(SpaceShipClass, TakeoffLoc.GetLocation(), TakeoffLoc.Rotator(), SpawnParams); | ||||
| 	PlayerOnShip = true; | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -270,13 +270,16 @@ public: | ||||
| 
 | ||||
| 	bool bIsCurrentlyHoldingWeapon; | ||||
| 
 | ||||
| 	// Space Ship
 | ||||
| 	// Hover Bike
 | ||||
| private: | ||||
| 	UPROPERTY(EditDefaultsOnly, Category = "Space Ship") | ||||
| 	UPROPERTY(EditDefaultsOnly, Category = "Hover Bike") | ||||
| 	float BikeRideHeight = 50; | ||||
| 	UPROPERTY(EditDefaultsOnly, Category = "Hover Bike") | ||||
| 	TSubclassOf<ASpaceShip> SpaceShipClass; | ||||
| 	ASpaceShip* SpaceShip; | ||||
| protected: | ||||
| 	bool PlayerOnShip = false; | ||||
| 	void HoldInteract(); | ||||
| public: | ||||
| 	void ExitShip(FTransform ExitLoc); | ||||
| 	void EnterShip(FTransform TakeoffLoc); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user