Untitled

 avatar
unknown
plain_text
4 years ago
725 B
3
Indexable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MovementController : MonoBehaviour
{
    public float SpeedMovement = 3;
        Rigidbody m_Rigidbody;
        Vector3 movement;

    // Start is called before the first frame update
    void Start()
    {
        m_Rigidbody = GetComponent<Rigidbody>();
    }

    // Update is called once per frame
    void Update()
    {
        float HorizontalMovement = Input.GetAxis("Horizontal");
        float VerticalMovement = Input.GetAxis("Vertical");
        Vector3 movement = new Vector3(HorizontalMovement, 0.0f, VerticalMovement);


        m_Rigidbody.AddForce( movement * SpeedMovement);


    }
}
Editor is loading...