Unityでいい感じにプレイヤーを動かしたい
ただのメモです
動画は作りかけのゲーム画面
・現状
・C#
※InputManagerをちょいちょいいじってます
using UnityEngine;
using System.Collections;
public class controller : MonoBehaviour {
public Rigidbody rigidbody;
float rotspd = 1.2f;
float movspd = 0.05f;
float dash = 1.0f;
void start () {
}
void FixedUpdate () {
float v = Input.GetAxis ("Vertical");
float h = Input.GetAxis ("Horizontal");
float r = Input.GetAxis ("Rotation");
if (Input.GetKey (KeyCode.LeftShift)) {
dash = 2.5f;
}
else {
dash =1.0f;
}
transform.Rotate(0, r * rotspd, 0);
transform.Translate (h * movspd, 0, v * movspd * dash);
}
}
おわり