LazyBot/Assets/Scripts/Entity/EntityControllerSimple.cs
/// <summary>
/// Moves entity in the scene.
/// </summary>
Moves entity in the scene.
Moves entity in the scene .
public override void Move()
        {
            _direction = _destination - _transform.position;
            float step = _angularSpeed * Mathf.Deg2Rad * Time.deltaTime;
            Vector3 newDir = Vector3.RotateTowards(_transform.forward, _direction, step, 0.0f);
            _transform.rotation = Quaternion.LookRotation(newDir);
            _transform.Translate(Vector3.forward * _speed * Time.deltaTime);
        }
public override void Move ( ) { _direction = _destination - _transform . position ; float step = _angularSpeed * Mathf . Deg2Rad * Time . deltaTime ; Vector3 newDir = Vector3 . RotateTowards ( _transform . forward , _direction , step , 0.0f ) ; _transform . rotation = Quaternion . LookRotation ( newDir ) ; _transform . Translate ( Vector3 . forward * _speed * Time . deltaTime ) ; }
Moves entity in the scene.
Moves entity in the scene .
//Debug.DrawRay(_transform.position, newDir, Color.red);