Guest User

Untitled

a guest
Dec 30th, 2019
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #region SkateboardControl stuff
  2. public float SteeringInput
  3. {
  4. get
  5. {
  6. if (!ValidateReferences()) { return 0f; }
  7. return playerInput.GetAxis(Axis.Turning);
  8. }
  9. }
  10. public float TwistInput
  11. {
  12. get
  13. {
  14. if (!ValidateReferences()) { return 0f; }
  15. return playerInput.GetAxis(Axis.Twist);
  16. }
  17. }
  18. public float PushingInput
  19. {
  20. get
  21. {
  22. if (!ValidateReferences()) { return 0f; }
  23. float inputVal = playerInput.GetAxis(Axis.Pushing);
  24.  
  25. // 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.
  26. if (targetBoard == null || inputVal > SteeringPushFromStoppedDeadzone) { return inputVal; }
  27. if (Mathf.Abs(SteeringInput) > SteeringPushDeadzone && targetBoard.Movement.CurTargetSpeed == 0f && (!targetBoard.IsOnAir || targetBoard.Movement.IsTiltedBack)) { return -1.0f; }
  28.  
  29. return inputVal;
  30. }
  31. }
  32. #endregion
Advertisement
Add Comment
Please, Sign In to add comment