기본적으로 유니티에서 객체를 움직이는 방법은 다양하지만 일반적으로 2가지를 사용한다. 1.transform position 이용 -객체의 포지션 값을 조정하여 이동한다. gameobject.transform.position = Vector3.MoveTowards(gameobject.transform.position, target.transform.position, speed * Time.deltaTime); 2.rigidbody addforce 이용 -객체의 포지션 값을 조정하여 이동한다. gameobject.GetComponent().AddForce(new Vector3(0,0, moveSpeed)); [tag] #AddForce #gameobject #movespeed #position #rigidb..
[1분 해결] 유니티(unity) 싱글톤 구현 구현 public class NFCHelper : MonoBehaviour { private static NFCHelper instance = null; void Awake() { if (null == instance) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this.gameObject); } } public static NFCHelper Instance { get { if (null == instance) { return null; } return instance; } } public void Test(){ } } 사용 NfcHelper.Instance.Test() 태..
오류메세지 TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations 메세지 발생 해결 방법 Unity in Assets -> Reimport All 참조링크 https://www.reddit.com/r/Unity3D/comments/75syxl/solved_tls_allocator_alloc_temp_thread_underlying/ [Solved] TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations Using: Unity 2017.1.0f3 I had switched my..