プレーヤー②(プレーヤーを動かす)
![Aaab02c4 64d2 457b b094 ddc04c3fc9ce](https://codegenius.org/uploads/slide/image/4515/aaab02c4-64d2-457b-b094-ddc04c3fc9ce.jpeg)
プレーヤーを動かす
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);
}
}
![8e03fbe3 0b11 4b32 b143 65cd55839a68](https://codegenius.org/uploads/slide/image/4516/8e03fbe3-0b11-4b32-b143-65cd55839a68.jpeg)
【2019版】Danmaku I(基礎1/全22回)
他のコースを見る![Aaab02c4 64d2 457b b094 ddc04c3fc9ce](https://codegenius.org/uploads/slide/image/4515/aaab02c4-64d2-457b-b094-ddc04c3fc9ce.jpeg)
プレーヤーを動かす
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);
}
}
![8e03fbe3 0b11 4b32 b143 65cd55839a68](https://codegenius.org/uploads/slide/image/4516/8e03fbe3-0b11-4b32-b143-65cd55839a68.jpeg)
プレーヤー②(プレーヤーを動かす)