Author name: astronautjin

[Unity] Basic Inputs

Keyboard/Controller Inputs GetButtonDown//TBD GetAxis, GetAxisRawex)  //one time press, not continuous public RectTransform myCurser;Vector3 myOffset = new Vector3(200, 0, 0);bool inUseFlag = false;void Update(){ if(Input.GetAxisRaw(“Horizontal”) != 0)  {    if(!inUseFlag)    {      myCurser.localPosition += Input.GetAxisRaw(“Horizontal”) * myOffset;      inUseFlag = true;    }  }  else  {    inUseFlag = false;  }} Touch Inputs

[Unity] Basic Inputs Read More »

[Unity] Basic Movements

In most cases, you first need to get either transform variable or rigidbody variable of an object. Transform.position*”transform” is a variable that refers to the transform of the object the script is attached to. No need to declare.ex) transform.position += new Vector3(1, 1, 1) * Time.deltaTime; Transform.translateex) transform.translate(new Vector3(1, 1, 1) * Time.deltaTime); Rigidbody.velocityex) public

[Unity] Basic Movements Read More »

Scroll to Top