Help us understand the problem. What is going on with this article?

プレイヤーの上下左右の移動と攻撃※編集中

More than 1 year has passed since last update.
Player.cs
using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour
{

    private CharacterController characterController;
    private Vector3 velocity;
    [SerializeField]
    private float walkSpeed;
    private Animator animator;

    void Start()
    {
        characterController = GetComponent<CharacterController>();
        animator = GetComponent<Animator>();
    }

     void Update()
    {
        if (Input.GetButtonDown("Fire1"))

        {
            animator.SetBool("Attack", true);
        }
        if (characterController.isGrounded)
        {
            velocity = new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));

            if (velocity.magnitude > 0.1f)
            {
                animator.SetBool("isRunning", true);
                transform.LookAt(transform.position + velocity);
            }
            else
            {
                animator.SetBool("isRunning", false);
            }
        }
        velocity.y += Physics.gravity.y * Time.deltaTime;
        characterController.Move(velocity * walkSpeed * Time.deltaTime);
    }
}
Getabako
はじめまして! 子どもにゲーム作りを通して表現力を伸ばすことを教えています 元々は臨床心理士で特別支援教育的なことをやっていました 人生が面白くなれば良いなぁと思っています 一緒に何か面白そうなことができそうと思った方はホームページより連絡下さい♪
http://getabakoclub.com
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした