유니티마스터1 [Unity 2D / 유니티 교과서] 5장 예제 + 이동범위 제한 Mathf.Clamp(value, min, max)를 사용하여 x좌표 이동범위 제한 using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float radius; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { float posX = Mathf.Clamp(transform.position.x, -8.0f, 8.0f); if (Input.GetKeyDown(KeyC.. 2023. 1. 31. 이전 1 다음