From cd1e6602a82ce2bbb8712f1507af0bdac1566c88 Mon Sep 17 00:00:00 2001 From: MarcUs7 <96580944+MarcUs7i@users.noreply.github.com> Date: Fri, 5 Jul 2024 19:40:07 +0200 Subject: [PATCH] on death animation fixed --- Assets/game/Scenes/level2.unity | 2 +- Assets/game/player/scripts/PlayerMove.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/game/Scenes/level2.unity b/Assets/game/Scenes/level2.unity index caeebc74..e81048b5 100644 --- a/Assets/game/Scenes/level2.unity +++ b/Assets/game/Scenes/level2.unity @@ -2524,7 +2524,7 @@ Transform: m_GameObject: {fileID: 406194634} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -3.71, y: 2.7, z: 0} - m_LocalScale: {x: 0.5, y: 0.5, z: 1} + m_LocalScale: {x: 0.7, y: 0.7, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/game/player/scripts/PlayerMove.cs b/Assets/game/player/scripts/PlayerMove.cs index bd50c621..0c938171 100644 --- a/Assets/game/player/scripts/PlayerMove.cs +++ b/Assets/game/player/scripts/PlayerMove.cs @@ -90,6 +90,16 @@ public class PlayerMove : MonoBehaviour animator.SetBool("IsJumping", true); }*/ + if(StopMoving) + { + rb2d.constraints = RigidbodyConstraints2D.FreezeAll; + RunningAnimation = false; + } + else + { + rb2d.constraints = RigidbodyConstraints2D.FreezeRotation; + } + if(rb2d.velocity == Vector2.zero && CameraController.CameraPlayer == true && StopMoving == false) { if(verticalInput > 0)