2017-05-07 18:48:56 +02:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class Character : SyncBase {
|
2017-05-07 21:44:35 +02:00
|
|
|
|
public float MovementSpeed = 5.0f;
|
|
|
|
|
public CharacterController CharacterController;
|
2017-05-07 18:48:56 +02:00
|
|
|
|
|
2017-05-07 21:44:35 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Moves the character in the wanted direction. Should be called on the physics tick. (FixedUpdate)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Direction">Movement direction.</param>
|
|
|
|
|
public void Move(Vector3 Direction) {
|
|
|
|
|
CharacterController.Move(Direction.normalized * MovementSpeed * Time.fixedDeltaTime);
|
|
|
|
|
}
|
2017-05-07 18:48:56 +02:00
|
|
|
|
}
|