diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 60099667..5312a980 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -1,9 +1,19 @@ [/Script/EngineSettings.GameMapsSettings] -GameDefaultMap=/Engine/Maps/Templates/Template_Default.Template_Default EditorStartupMap=/Engine/Maps/Templates/Template_Default.Template_Default +LocalMapOptions= +TransitionMap=None +bUseSplitscreen=True +TwoPlayerSplitscreenLayout=Horizontal +ThreePlayerSplitscreenLayout=FavorTop +FourPlayerSplitscreenLayout=Grid +bOffsetPlayerGamepadIds=False +GameInstanceClass=/Script/Engine.GameInstance +GameDefaultMap=/Engine/Maps/Templates/Template_Default.Template_Default +ServerDefaultMap=/Engine/Maps/Entry.Entry GlobalDefaultGameMode=/Game/Unbread/Core/GameModes/BP_GameMode.BP_GameMode_C +GlobalDefaultServerGameMode=None [/Script/WindowsTargetPlatform.WindowsTargetSettings] DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 diff --git a/Content/Unbread/Art/Environment_Assets/Oven_10x6.uasset b/Content/Unbread/Art/Environment_Assets/Oven_10x6.uasset new file mode 100644 index 00000000..9a34bd4d --- /dev/null +++ b/Content/Unbread/Art/Environment_Assets/Oven_10x6.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ced43d68bef62f0af7ac120099fc149fbbf2e925f4b5930cf20ccfc6a5a8f3dd +size 5337889 diff --git a/Content/Unbread/Art/Materials/M_Diffuse_Material.uasset b/Content/Unbread/Art/Materials/M_Diffuse_Material.uasset index 389dec79..0d2268d6 100644 --- a/Content/Unbread/Art/Materials/M_Diffuse_Material.uasset +++ b/Content/Unbread/Art/Materials/M_Diffuse_Material.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40faf17bdb71e46434ba9253d2e1a258dfc65f3decf08fcd94c875be17fe7768 -size 11173 +oid sha256:d947579a05c83e4783f712e7dbca0ac2ae076d6bf442d40d1df15ab84dc88176 +size 12405 diff --git a/Content/Unbread/Art/Materials/M_Shiny_Material.uasset b/Content/Unbread/Art/Materials/M_Shiny_Material.uasset index c248572b..d286a2a5 100644 --- a/Content/Unbread/Art/Materials/M_Shiny_Material.uasset +++ b/Content/Unbread/Art/Materials/M_Shiny_Material.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4f6d41878dbc9094ed753a1988c11f8d79eeacb559a0d3066ab976e67ff700a1 -size 11823 +oid sha256:cf77bab2e03b1d1fceef38e1f9d35707e820323f2c98b5a5d5f55d958e354c0d +size 12874 diff --git a/Content/Unbread/Core/Character/BP_Character.uasset b/Content/Unbread/Core/Character/BP_Character.uasset index e7965a81..a1d362f7 100644 --- a/Content/Unbread/Core/Character/BP_Character.uasset +++ b/Content/Unbread/Core/Character/BP_Character.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:518b56ff0cc4b4e08165abade2e7fd6bce37e54382f688f800fcd9f1efd62df5 -size 261501 +oid sha256:99aff1017d883fb00036b75672a290733a81c8a041ef355053e0a01d358f3630 +size 373783 diff --git a/Content/Unbread/Core/DynamicCamera/Release/BP_CameraRegisterLookAtTarget.uasset b/Content/Unbread/Core/DynamicCamera/Release/BP_CameraRegisterLookAtTarget.uasset new file mode 100644 index 00000000..8b2a6ea5 --- /dev/null +++ b/Content/Unbread/Core/DynamicCamera/Release/BP_CameraRegisterLookAtTarget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bd1b9b66291005cb1d3680a48e7a3373e3dd6b3b26352c2345cc302863e4e32 +size 86759 diff --git a/Content/Unbread/Core/GameModes/BP_GameMode.uasset b/Content/Unbread/Core/GameModes/BP_GameMode.uasset index 01535c55..21cea205 100644 --- a/Content/Unbread/Core/GameModes/BP_GameMode.uasset +++ b/Content/Unbread/Core/GameModes/BP_GameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:afacb9f4706703d9e026d6601bf5b797ccf013ced4e9e86ebc6a0c42b6adda5e -size 19696 +oid sha256:da815b1573c98093da7bcae918a2bee48b7e0d6590c1f4a47d7c7214c28368fa +size 20183 diff --git a/Content/Unbread/Environment/Hazards/BP_TestKillVolume.uasset b/Content/Unbread/Environment/Hazards/BP_TestKillVolume.uasset new file mode 100644 index 00000000..d01d5700 --- /dev/null +++ b/Content/Unbread/Environment/Hazards/BP_TestKillVolume.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:382774e09224087ce0484a7b39156e46fa47b2bb3a6ab2e49fa690e49dcafcd5 +size 62028 diff --git a/Content/Unbread/Maps/BlockoutLevelTest.umap b/Content/Unbread/Maps/BlockoutLevelTest.umap new file mode 100644 index 00000000..d7090358 --- /dev/null +++ b/Content/Unbread/Maps/BlockoutLevelTest.umap @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afee160c5e2a5caf6758d389e41779f37ff99449c643f14cf69560de131ae899 +size 101423 diff --git a/Content/Unbread/Maps/CharacterTest01.umap b/Content/Unbread/Maps/CharacterTest01.umap index 1aebfe54..d66f63ad 100644 --- a/Content/Unbread/Maps/CharacterTest01.umap +++ b/Content/Unbread/Maps/CharacterTest01.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42e011b3f2045c2da278a4f40ab80460a10d6ad5085b4238b66d2352e8685789 -size 72721 +oid sha256:ab546aa81fcfa73456c43f7f5238ce8e507a8c89aa19b5fd49ad286ab7664fa7 +size 71676 diff --git a/Source/unbread/DynamicCameraComponent.cpp b/Source/unbread/DynamicCameraComponent.cpp index cd0e8f98..ca31d03c 100644 --- a/Source/unbread/DynamicCameraComponent.cpp +++ b/Source/unbread/DynamicCameraComponent.cpp @@ -50,16 +50,28 @@ void UDynamicCameraComponent::SetNextCamera(AActor* CameraActor) // Transitions to the next camera void UDynamicCameraComponent::TransitionCamera(const float TransitionTime) { + + // Do nothing if there is no camera actor to transition to if(NextCameraActor == nullptr) { - return; + if(DefaultCameraActor == nullptr) + { + return; + } + + NextCameraActor = DefaultCameraActor; } + UGameplayStatics::GetPlayerController(GetWorld(), 0)->DisableInput(UGameplayStatics::GetPlayerController(GetWorld(), 0)); + // Transition to the NextCameraActor UGameplayStatics::GetPlayerController(GetWorld(), 0)->SetViewTargetWithBlend(NextCameraActor, TransitionTime); CurrentCameraActor = NextCameraActor; + //NextCameraActor = nullptr; + UGameplayStatics::GetPlayerController(GetWorld(), 0)->EnableInput(UGameplayStatics::GetPlayerController(GetWorld(), 0)); + if(DefaultCameraActor == nullptr) DefaultCameraActor = CurrentCameraActor; return; diff --git a/Source/unbread/Private/SCharacter.cpp b/Source/unbread/Private/SCharacter.cpp index c21fc633..eb8fa6d6 100644 --- a/Source/unbread/Private/SCharacter.cpp +++ b/Source/unbread/Private/SCharacter.cpp @@ -16,6 +16,8 @@ #include "SPlayerState.h" #include "SGameplayAbility.h" #include "SHealthAttributeSet.h" +#include "Camera/CameraActor.h" +#include "Kismet/KismetMathLibrary.h" // Sets default values @@ -82,13 +84,35 @@ void ASCharacter::Move(const FInputActionValue& Value) { const FVector2D MoveVector = Value.Get(); FVector2d NormalizedMoveVector = MoveVector.GetSafeNormal(); + + FVector Forward, Right; + + // Get the camera transform + if(DynamicCamera->CurrentCameraActor) + { + //const auto Camera = Cast(DynamicCamera->CurrentCameraActor); + //Right = FVector(1.f, 0.f, 0.f); + //Forward = FVector(0.f, 1.f, 0.f); + + const FRotator CameraWorldRotation = DynamicCamera->CurrentCameraActor->GetComponentByClass()->GetRelativeRotation() + DynamicCamera->CurrentCameraActor->GetActorRotation(); + + //Forward = UKismetMathLibrary::GetForwardVector(CameraWorldRotation); + Right = UKismetMathLibrary::GetRightVector(CameraWorldRotation); //Forward.RotateAngleAxis(90.f, FVector(0.f, 0.f, 1.f)); + Forward = Right.RotateAngleAxis(-90.f, FVector(0.f, 0.f, 1.f)); + } + + else + { + Forward = FVector(1.f, 0.f, 0.f); + Right = FVector(0.f, 1.f, 0.f); + } + // Forward / Backward - const FVector Forward = FVector(1.f, 0.f, 0.f); + AddMovementInput(Forward, NormalizedMoveVector.Y * Speed); // Right / Left - const FVector Right = FVector(0.f, 1.f, 0.f); AddMovementInput(Right, NormalizedMoveVector.X * Speed); // TODO: Update forward and right vectors according to camera position and rotation @@ -158,6 +182,11 @@ void ASCharacter::Jump(const FInputActionValue& Value) void ASCharacter::Sprint() { + if(bIsHeadForm) + { + return; + } + bIsWalking = !bIsWalking; if (bIsWalking) { @@ -183,6 +212,11 @@ void ASCharacter::CheckAmmo() void ASCharacter::ShootProjectile() { + if(bIsHeadForm) + { + return; + } + FVector ProjectileSpawnLocation = GetMesh()->GetSocketLocation("ProjectileSpawn") + FVector(0.f, 0.f, 150.f); FRotator ProjectileSpawnRotation = GetMesh()->GetRelativeRotation() + FRotator(0.0f, 90.f, -10.f); FTransform SpawnTM = FTransform(ProjectileSpawnRotation, ProjectileSpawnLocation); diff --git a/Source/unbread/Public/CameraRegisterVolume.cpp b/Source/unbread/Public/CameraRegisterVolume.cpp index 94371806..a141d212 100644 --- a/Source/unbread/Public/CameraRegisterVolume.cpp +++ b/Source/unbread/Public/CameraRegisterVolume.cpp @@ -57,7 +57,10 @@ void ACameraRegisterVolume::OnEnterVolume(UPrimitiveComponent* OverlappedComp, A void ACameraRegisterVolume::OnExitVolume(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) { if(OtherActor->GetClass()->ImplementsInterface(UDynamicCameraInterface::StaticClass())) { - IDynamicCameraInterface::Execute_SetNextCamera(OtherActor, nullptr); + if(bResetCameraOnExit) + { + IDynamicCameraInterface::Execute_SetNextCamera(OtherActor, nullptr); + } IDynamicCameraInterface::Execute_TransitionCamera(OtherActor, CameraTransitionTime); } } diff --git a/Source/unbread/Public/CameraRegisterVolume.h b/Source/unbread/Public/CameraRegisterVolume.h index 08f740dd..8c5b3803 100644 --- a/Source/unbread/Public/CameraRegisterVolume.h +++ b/Source/unbread/Public/CameraRegisterVolume.h @@ -22,6 +22,9 @@ class UNBREAD_API ACameraRegisterVolume : public AActor UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Settings") float CameraTransitionTime = 0.5f; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Settings") + bool bResetCameraOnExit = false; + protected: // Called when the game starts or when spawned virtual void BeginPlay() override; diff --git a/Source/unbread/Public/SCharacter.h b/Source/unbread/Public/SCharacter.h index e57b098b..3497e6ef 100644 --- a/Source/unbread/Public/SCharacter.h +++ b/Source/unbread/Public/SCharacter.h @@ -115,6 +115,9 @@ class UNBREAD_API ASCharacter : public ACharacter, public IDynamicCameraInterfac bool bIsWalking; void Sprint(); + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + bool bIsHeadForm = false; // TEMPORARY PROJECTILE ATTACK UPROPERTY(EditAnywhere)