Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (input3.Contains (touch.position)) {
- leanRight ();
- leaning = true;
- Touch3 = true;
- }
- if (Input.GetKey ("right")) {
- leanRight ();
- leaning = true;
- Touch3 = true;
- }
- void leanRight ()
- {
- if (GameObject.FindGameObjectWithTag ("Dude")) {
- rightLeg.localRotation = Quaternion.Slerp (rightLeg.localRotation, Quaternion.Euler (-50+pedalR+15, 0, 0), Time.deltaTime * dudeSpeed) ;
- leftLeg.localRotation = Quaternion.Slerp (leftLeg.localRotation, Quaternion.Euler (-50+pedalL+15, 0, 0), Time.deltaTime * dudeSpeed) ;
- Forarm.localRotation = Quaternion.Slerp (Forarm.localRotation, Quaternion.Euler (70, 0, 0), Time.deltaTime * dudeSpeed) ;
- Arm.localRotation = Quaternion.Slerp (Arm.localRotation, Quaternion.Euler (-95, 0, 0), Time.deltaTime * dudeSpeed) ;
- body.localPosition = Vector3.Slerp (body.localPosition, new Vector3 (0, 0f, 1.9f), Time.deltaTime * dudeSpeed) ;
- weight.GetComponent<ConfigurableJoint>().targetPosition = new Vector3 (0, -1.5f, -1);
- body.localRotation = Quaternion.Slerp (body.localRotation, Quaternion.Euler (-32, 0, 0), Time.deltaTime * dudeSpeed) ;
- }
- foreach (GameObject temp in list2) {
- JointMotor newMotor = new JointMotor ();
- if (temp.hingeJoint != null) {
- newMotor.force = 10;
- newMotor.targetVelocity = leanSpeed;
- newMotor.freeSpin = true;
- temp.hingeJoint.motor = newMotor;
- }
- }
- }
Add Comment
Please, Sign In to add comment