diff --git a/Assets/Scripts/ChildController.cs b/Assets/Scripts/ChildController.cs index 324ff84..2f33e1d 100644 --- a/Assets/Scripts/ChildController.cs +++ b/Assets/Scripts/ChildController.cs @@ -89,6 +89,18 @@ public class ChildController : MonoBehaviour transform.eulerAngles.z); } } + else { + _child.target = null; // no auto targeting when not actively pressing the joystick in a direction + + // if player is not look with the right joystick, then face the direction we're going + // if left joystick is used, else we don't change the facing direction + if (xValue != 0 || zValue!= 0) { + transform.eulerAngles = new Vector3( + transform.eulerAngles.x, + Mathf.Atan2(xValue, zValue) * Mathf.Rad2Deg - 90, + transform.eulerAngles.z); + } + } if (input.Ranges.ContainsKey("Throw")) { _child.Throw();