캐릭터 좌우 이동 시 캐릭터 이미지 반전 적용
This commit is contained in:
@@ -44,6 +44,16 @@ namespace TON
|
|||||||
|
|
||||||
// 디버그용 출력
|
// 디버그용 출력
|
||||||
// Debug.Log($"Horizontal Input: {horizontalInput}, Velocity: {rb.velocity}");
|
// Debug.Log($"Horizontal Input: {horizontalInput}, Velocity: {rb.velocity}");
|
||||||
|
Turn(rb.velocity.x);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Turn(float direction)
|
||||||
|
{
|
||||||
|
var scale = transform.localScale;
|
||||||
|
|
||||||
|
scale.x = Mathf.Sign(direction) * Mathf.Abs(scale.x);
|
||||||
|
|
||||||
|
transform.localScale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Jump()
|
public void Jump()
|
||||||
|
|||||||
Reference in New Issue
Block a user