Guest User

Untitled

a guest
Jun 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. if (input3.Contains (touch.position)) {
  2. leanRight ();
  3. leaning = true;
  4. Touch3 = true;
  5. }
  6.  
  7. if (Input.GetKey ("right")) {
  8. leanRight ();
  9. leaning = true;
  10. Touch3 = true;
  11. }
  12.  
  13. void leanRight ()
  14. {
  15. if (GameObject.FindGameObjectWithTag ("Dude")) {
  16. rightLeg.localRotation = Quaternion.Slerp (rightLeg.localRotation, Quaternion.Euler (-50+pedalR+15, 0, 0), Time.deltaTime * dudeSpeed) ;
  17. leftLeg.localRotation = Quaternion.Slerp (leftLeg.localRotation, Quaternion.Euler (-50+pedalL+15, 0, 0), Time.deltaTime * dudeSpeed) ;
  18. Forarm.localRotation = Quaternion.Slerp (Forarm.localRotation, Quaternion.Euler (70, 0, 0), Time.deltaTime * dudeSpeed) ;
  19. Arm.localRotation = Quaternion.Slerp (Arm.localRotation, Quaternion.Euler (-95, 0, 0), Time.deltaTime * dudeSpeed) ;
  20. body.localPosition = Vector3.Slerp (body.localPosition, new Vector3 (0, 0f, 1.9f), Time.deltaTime * dudeSpeed) ;
  21. weight.GetComponent<ConfigurableJoint>().targetPosition = new Vector3 (0, -1.5f, -1);
  22. body.localRotation = Quaternion.Slerp (body.localRotation, Quaternion.Euler (-32, 0, 0), Time.deltaTime * dudeSpeed) ;
  23. }
  24. foreach (GameObject temp in list2) {
  25. JointMotor newMotor = new JointMotor ();
  26. if (temp.hingeJoint != null) {
  27. newMotor.force = 10;
  28. newMotor.targetVelocity = leanSpeed;
  29. newMotor.freeSpin = true;
  30. temp.hingeJoint.motor = newMotor;
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment