Skip to content

Commit

Permalink
Merge pull request #76 from MashdorDev/AnimationFixes
Browse files Browse the repository at this point in the history
Animation fixes and Spline Camera
  • Loading branch information
GageM authored Feb 15, 2024
2 parents 6b2869f + 43a388c commit 7484a59
Show file tree
Hide file tree
Showing 20 changed files with 55 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Content/Unbread/Art/Characters/Donut/Donut.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/Unbread/Art/Characters/Donut/Donut_Attack.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Art/Characters/Donut/Donut_Skeleton.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/Unbread/Art/Characters/Donut/Donut_Walk.uasset
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Art/Characters/Loaf/Loaf.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/Unbread/Art/Characters/Loaf/Loaf_Attack.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Art/Characters/Loaf/Loaf_Skeleton.uasset
Git LFS file not shown
3 changes: 3 additions & 0 deletions Content/Unbread/Art/Characters/Loaf/Loaf_Walk.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Core/Character/BP_Character.uasset
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Core/Character/BP_CharacterRotation.uasset
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
4 changes: 2 additions & 2 deletions Content/Unbread/Maps/DynamicCameraTest01.umap
Git LFS file not shown
11 changes: 9 additions & 2 deletions Source/unbread/Private/SCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,15 @@ void ASCharacter::Rotate(const FInputActionValue& Value)
{
const FVector2D RotVector = Value.Get<FVector2D>();
const float Angle = FMath::Atan2(RotVector.Y, RotVector.X) * (180.0f / PI);
const FRotator NewRotation = FRotator(0.0f, -1* Angle, 0.0f);
GetMesh()->SetRelativeRotationExact(NewRotation);

// !!Safak please check if this change is okay with you!!

// Rotate the character relative to the current camera
FRotator CameraWorldRotation = DynamicCamera->CurrentCameraActor->GetComponentByClass<UCameraComponent>()->GetRelativeRotation() + DynamicCamera->CurrentCameraActor->GetActorRotation();
CameraWorldRotation.Roll = 0.f;
CameraWorldRotation.Pitch = 0.f;
const FRotator NewRotation = FRotator(0.0f, -1* Angle, 0.0f) + CameraWorldRotation;
GetMesh()->SetWorldRotation(NewRotation);
}

void ASCharacter::RotateToTarget(const FVector LookAtTarget)
Expand Down
3 changes: 2 additions & 1 deletion Source/unbread/Public/CameraRegisterVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ACameraRegisterVolume::ACameraRegisterVolume()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
PrimaryActorTick.bStartWithTickEnabled = true;

// Create and set the Root component
Root = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
Expand Down Expand Up @@ -39,7 +40,7 @@ void ACameraRegisterVolume::BeginPlay()
// Called every frame
void ACameraRegisterVolume::Tick(float DeltaTime)
{
Super::BeginPlay();
Super::Tick(DeltaTime);
}

void ACameraRegisterVolume::OnEnterVolume(UPrimitiveComponent* OverlappedComp, AActor* OtherActor,
Expand Down

0 comments on commit 7484a59

Please sign in to comment.