プレーヤー②(プレーヤーを動かす)
![7e166b46 fb03 472d b3c9 b9bf53d836ee](https://codegenius.org/uploads/slide/image/7470/7e166b46-fb03-472d-b3c9-b9bf53d836ee.jpeg)
Playerを動かす
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, moveV);
}
}
![Dd4f0d13 c907 45dd a0be bba8443ccc61](https://codegenius.org/uploads/slide/image/7471/dd4f0d13-c907-45dd-a0be-bba8443ccc61.jpeg)
【2021版】Danmaku(基礎/全55回)
他のコースを見る![7e166b46 fb03 472d b3c9 b9bf53d836ee](https://codegenius.org/uploads/slide/image/7470/7e166b46-fb03-472d-b3c9-b9bf53d836ee.jpeg)
Playerを動かす
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, moveV);
}
}
![Dd4f0d13 c907 45dd a0be bba8443ccc61](https://codegenius.org/uploads/slide/image/7471/dd4f0d13-c907-45dd-a0be-bba8443ccc61.jpeg)
プレーヤー②(プレーヤーを動かす)