fix: rotation in relation to camera no longer broken
This commit is contained in:
@@ -56,8 +56,6 @@ namespace Reset.Units{
|
||||
// }
|
||||
|
||||
// Debug viewing
|
||||
|
||||
|
||||
// Smoothed Values
|
||||
[ShowInInspector, ReadOnly] private float outputSpeed;
|
||||
[ShowInInspector, ReadOnly] private Vector3 outputMoveDirection;
|
||||
@@ -83,7 +81,6 @@ namespace Reset.Units{
|
||||
DoMovement();
|
||||
}
|
||||
|
||||
|
||||
private void UpdateCurrentDirection(){
|
||||
// Construct move direction
|
||||
Vector3 targetDirection = data.targetMoveDirection;
|
||||
@@ -200,7 +197,7 @@ namespace Reset.Units{
|
||||
|
||||
public void DoMovement(Vector3 moveDir, float speed){
|
||||
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(){
|
||||
|
||||
Reference in New Issue
Block a user