revival/game/Assets/Scripts/Player/PlayerController.cs

29 lines
671 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
[SerializeField]
private PlayerMovementSettings _movementSettings;
[SerializeField]
private PlayerInputHandler _inputHandler;
[SerializeField]
private Rigidbody _rigidbody;
private void Start()
{
}
private void FixedUpdate()
{
Vector2 moveVector2 = _inputHandler.InputState.Move.Value;
Vector3 moveVector = new Vector3( moveVector2.x, 0f, moveVector2.y );
_rigidbody.velocity = moveVector * _movementSettings.BaseMovementSpeed;
}
}