Start : 2025/02/21 16:11 ~ 2025/02/21 18:40
→ B16 00:00 ~ B16 32:50
⇒ Player Jump와 Jump Animation, 그리고 RaycastHit2D 클래스를 사용하여 지면과의 충돌 조사
PlayerMove.cs
using UnityEngine;
public class PlayerMove : MonoBehaviour
{
...
public float jumpPower;
...
void Update()
{
...
// 플레이어 점프
if (Input.GetButtonDown("Jump"))
rigid.AddForce(Vector2.up * jumpPower, ForceMode2D.Impulse);
...
}
...
}
public float jumpPower;
→ 사용자 입력 받음Linear Damping
, Gravity Scale
값 조정하여 해결Y
⇒ -9.81
0.16666
1