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

28 lines
662 B
C#
Raw Normal View History

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()
{
2021-01-27 13:06:17 +01:00
Vector2 moveVector2 = _inputHandler.InputState.Move.Value;
Vector3 moveVector = new Vector3( moveVector2.x, 0f, moveVector2.y );
_rigidbody.velocity = moveVector * _movementSettings.BaseMovementSpeed;
}
}