on death animation fixed

This commit is contained in:
MarcUs7 2024-07-05 19:40:07 +02:00
parent 377e74cd4f
commit cd1e6602a8
2 changed files with 11 additions and 1 deletions

View file

@ -2524,7 +2524,7 @@ Transform:
m_GameObject: {fileID: 406194634} m_GameObject: {fileID: 406194634}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.71, y: 2.7, z: 0} 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_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}

View file

@ -90,6 +90,16 @@ public class PlayerMove : MonoBehaviour
animator.SetBool("IsJumping", true); 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(rb2d.velocity == Vector2.zero && CameraController.CameraPlayer == true && StopMoving == false)
{ {
if(verticalInput > 0) if(verticalInput > 0)