Hello,
I am fairly new to Unity and I wanted to know if there was a quick way to make an object follow its local y-axis. Like
transform.forward
follows the object’s local z-axis.
Hello,
I am fairly new to Unity and I wanted to know if there was a quick way to make an object follow its local y-axis. Like
transform.forward
follows the object’s local z-axis.
i believe you are looking for transform.up
//move up like this
transform.position += transform.up * Time.deltaTime;
//move down like this
transform.position += -transform.up * Time.deltaTime;
//move right like this
transform.position += transform.right * Time.deltaTime;
//move left like this
transform.position += -transform.right * Time.deltaTime;