プレーヤー②(プレーヤーを動かす)

プレーヤーを動かす
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 0.2f;
void Update()
{
float moveH = Input.GetAxis("Horizontal") * moveSpeed;
float moveV = Input.GetAxis("Vertical") * moveSpeed;
transform.Translate(moveH, 0.0f, moveV);
}
}



プレーヤーの動きを改良する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 0.2f;
void Update()
{
// Inputの前に「-」を付ける。
float moveH = -Input.GetAxis("Horizontal") * moveSpeed;
float moveV = -Input.GetAxis("Vertical") * moveSpeed;
transform.Translate(moveH, 0.0f, moveV);
}
}
Danmaku I(基礎1/全22回)
他のコースを見る
プレーヤーを動かす
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 0.2f;
void Update()
{
float moveH = Input.GetAxis("Horizontal") * moveSpeed;
float moveV = Input.GetAxis("Vertical") * moveSpeed;
transform.Translate(moveH, 0.0f, moveV);
}
}



プレーヤーの動きを改良する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed = 0.2f;
void Update()
{
// Inputの前に「-」を付ける。
float moveH = -Input.GetAxis("Horizontal") * moveSpeed;
float moveV = -Input.GetAxis("Vertical") * moveSpeed;
transform.Translate(moveH, 0.0f, moveV);
}
}
プレーヤー②(プレーヤーを動かす)