fix: rotation in relation to camera no longer broken
This commit is contained in:
@@ -56,8 +56,6 @@ namespace Reset.Units{
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// Debug viewing
|
// Debug viewing
|
||||||
|
|
||||||
|
|
||||||
// Smoothed Values
|
// Smoothed Values
|
||||||
[ShowInInspector, ReadOnly] private float outputSpeed;
|
[ShowInInspector, ReadOnly] private float outputSpeed;
|
||||||
[ShowInInspector, ReadOnly] private Vector3 outputMoveDirection;
|
[ShowInInspector, ReadOnly] private Vector3 outputMoveDirection;
|
||||||
@@ -82,7 +80,6 @@ namespace Reset.Units{
|
|||||||
//
|
//
|
||||||
DoMovement();
|
DoMovement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void UpdateCurrentDirection(){
|
private void UpdateCurrentDirection(){
|
||||||
// Construct move direction
|
// Construct move direction
|
||||||
@@ -200,7 +197,7 @@ namespace Reset.Units{
|
|||||||
|
|
||||||
public void DoMovement(Vector3 moveDir, float speed){
|
public void DoMovement(Vector3 moveDir, float speed){
|
||||||
Debug.Log( outputMoveDirection);;
|
Debug.Log( outputMoveDirection);;
|
||||||
controller.Move(moveDir * speed * Time.deltaTime);
|
controller.Move((Camera.main.transform.rotation.Flatten(0, null, 0) * (moveDir * speed) * Time.deltaTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LateUpdate(){
|
public void LateUpdate(){
|
||||||
|
|||||||
Reference in New Issue
Block a user