CLAMP
-
[unity - mathf] clamp에 관하여 (요약)unity 2022. 4. 1. 11:59
clamp는 mathf로 사용할 수 있으며 최대/최소값 사이의 float 값이 value 범위 외의 값이 되지 않도록 한다. 사용법 public class ExampleClass : MonoBehaviour { void Update() { transform.position = new Vector3(Mathf.Clamp(transform.position.y, 1.0F, 3.0F); } void Update() { 새로운 포지션 변수 = 백터 3 생성(Mathf.Clamp(y축 값, float형, float형); }