Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region SkateboardControl stuff
- public float SteeringInput
- {
- get
- {
- if (!ValidateReferences()) { return 0f; }
- return playerInput.GetAxis(Axis.Turning);
- }
- }
- public float TwistInput
- {
- get
- {
- if (!ValidateReferences()) { return 0f; }
- return playerInput.GetAxis(Axis.Twist);
- }
- }
- public float PushingInput
- {
- get
- {
- if (!ValidateReferences()) { return 0f; }
- float inputVal = playerInput.GetAxis(Axis.Pushing);
- // If we're slow enough to tilt back, and we're applying a significant steering input, and we're not attempting to push, AND we're grounded or already tilting back, automatically tilt back to assist in making that turn faster.
- if (targetBoard == null || inputVal > SteeringPushFromStoppedDeadzone) { return inputVal; }
- if (Mathf.Abs(SteeringInput) > SteeringPushDeadzone && targetBoard.Movement.CurTargetSpeed == 0f && (!targetBoard.IsOnAir || targetBoard.Movement.IsTiltedBack)) { return -1.0f; }
- return inputVal;
- }
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment