Unity2014. 8. 4. 16:18

using UnityEngine;

using System.Collections;


public class Move2 : MonoBehaviour {


public float moveSpeed = 5f;

public float turnSpeed = 180f;


// Use this for initialization

void Start () {

}

// Update is called once per frame

void Update () {

float h = Input.GetAxis ("Horizontal");

float v = Input.GetAxis ("Vertical");


transform.Translate (new Vector3 (0f, 0f, v * moveSpeed * Time.deltaTime));

}

}



'Unity' 카테고리의 다른 글

로컬좌표계에서 캐릭터 이동  (0) 2014.08.04
C# Input.GetAxis ("Vertical") 와 transform.Rotate()  (0) 2014.08.04
C# 회전  (0) 2014.08.04
C# 이동 Input.GetAxis ("Horizontal");  (0) 2014.08.04
C# Scrip on Unity  (0) 2014.08.04
Posted by 코드버무려