fix: non player units no longer rotate with camera
This commit is contained in:
@@ -62,7 +62,9 @@ namespace Reset.Units{
|
||||
Vector2 targetDirection = new Vector2(directionProvider.Direction.x, directionProvider.Direction.y);
|
||||
|
||||
// Rotate input by camera rotation (instead of rotating the output direction by camera rotation)
|
||||
targetDirection = (Camera.main.transform.rotation * targetDirection.ToVector3()).ToVector2();
|
||||
if (GetComponent<Player>()) {
|
||||
targetDirection = (Camera.main.transform.rotation * targetDirection.ToVector3()).ToVector2();
|
||||
}
|
||||
|
||||
// Deadzone
|
||||
if (targetDirection.magnitude < .1f) {
|
||||
|
||||
Reference in New Issue
Block a user