Unity3D(59)
-
22.01.24 Ray를 이용하기
ChestNutControl cn = Instantiate(chestNut).GetComponent(); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //Debug.DrawRay(ray.origin, ray.direction * 1000f, Color.red, 1.0f); Vector3 worldDir = ray.direction; cn.Shoot(worldDir.normalized * 2000f); 위 코드는 밤송이 던지기 게임에 작성된 코드이다. ray.direction은 ray의 방향을 나타낸다. 화면 상에서 마우스를 클릭했을 때, 커서 위치에서 ray를 발사한다. 그래서 이 ray의 방향을 활용할 수 있는 게임에 적당하다. (1인칭,..
2022.01.24 -
화면 보정 필터같은 Post Processing
https://docs.unity3d.com/kr/2019.4/Manual/BestPracticeMakingBelievableVisuals8.html
2022.01.24 -
22.01.24 Sling Chestnut
오브젝트에 리지드바디 컴포넌트를 부착하고 속성을 kinematic 으로 바꾸면 물체가 멈춘다.
2022.01.24 -
파티클 이펙트
png 텍스쳐를 넣은 머티리얼을 파티클 입자로 넣을 수 있다. 파티클 시스템 컴포넌트에서 주요한 4가지 속성 1) emission 2) shape 3) size over lifetime 4) renderer
2022.01.24 -
오브젝트의 부모를 설정했는데 스케일도 부모를 따라가버릴 때
https://ssscool.tistory.com/463 유니티 SetParent 했을 때 자식 오브젝트의 Scale이 다르게 될 때 Unity SetParent either shrinks my child object 유니티 SetParent 했을 때 자식 오브젝트의 Scale이 다르게 될 때 Unity SetParent either shrinks my child object or blows it up SetParent 함수를 사용할 때 인자로 그냥 부모 오브젝트의 트랜스폼만 사용했을.. ssscool.tistory.com SetParent메서드를 호출할 때 bool 인수를 넣는 것으로 해결할 수 있다. 혹은 https://docs.unity3d.com/kr/2018.4/Manual/class-Paren..
2022.01.22 -
유니티에서 시간의 속도를 조절할 때
public void TimeStop() { Time.timeScale = 0f; Time.fixedDeltaTime = 0.02f * Time.timeScale; } 왜 fixedDeltaTime 까지 조정해야 하는 지 공부하기
2022.01.22