-
[ TIL - 220928 ]Today I Learned 2022. 9. 29. 17:32
π μ΄μ체μ
νλ‘μΈμ€ : λ³ν μ€ν νλ‘κ·Έλ¨μ λ°μ μ λ€μν νλ‘κ·Έλ¨μ λ³΄λ€ κ²¬κ³ νκ² μ μ΄νκ³ λ³΄λ€ κ΅¬ννν κ²μ νμλ‘ νλ©΄μ νλ‘μΈμ€μ κ°λ μ λ³μμΌλ©°, νλ‘μΈμ€λ μ€ν μ€μΈ νλ‘κ·Έλ¨μ λ§νλ€. νλ‘μΈμ€λ νλ μ»΄ν¨ν μμ€ν μμ μμ μ λ¨μμ΄λ€.
πμ λν° : μκ²½μκ°μ§κ³ μμ νΉν μ΄ν΄μλλ ..
using System.Collections; using System.Collections.Generic; using UnityEngine; public class moveTest : MonoBehaviour { // Start is called before the first frame update void Start() { public float moveSpeed = 0.1f; public float rotationSpeed = 1f; } // Update is called once per frame void Update() { float xInput = Input.GetAxis("Horizontal"); float zInput = Input.GetAxis("Vertical"); transform.Translate(0,0,zInput*moveSpeed); //Translateλ ν¨μ transform.Rotate(0,xInput*rotationSpeed,0); } }
π νλ‘κ·Έλλ° μΈμ΄λ‘ 볡μ΅π λ°μ΄ν° ν΅μ
'Today I Learned' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[ TIL 221120 ] (0) 2022.11.21 [ TIL 221028 ] (0) 2022.11.20 [ TIL 220927 ] (0) 2022.09.28 [ TIL 220922 ] THU (0) 2022.09.24 [ TIL 220921 ] (1) 2022.09.22