// Use this to get a normalized translation vector in the x & z plane public static Vector3 GetNormalizedTranslation() { Motus_1_MovementVector local = _vector; local.Normalize(); Vector3 rtn = new Vector3(local.LateralComponent, 0f, local.VerticalComponent); rtn = _inGameOffset * rtn; if (rtn.magnitude != 0) { if (!_isMoving) { _movingStateChange = true; _isMoving = true; } } else { if (_isMoving) { _movingStateChange = true; _isMoving = false; } } return(rtn); }
// Update is called once per frame public static void Update() { Motus1.Service(); _vector = Motus1.GetMotionVector(); _platform = Motus1.GetRawPlatformData(); }