Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Controller : MonoBehaviour
- {
- public HingeJoint leftJoint, rightJoint;
- private void Update()
- {
- if (Input.GetButton("INPUTPOURLAGAUCHE")
- {
- JointLimits limits = leftJoint.limits;
- limits.min = 90;
- limits.max = 90;
- leftJoint.limits = limits;
- }
- else
- {
- JointLimits limits = leftJoint.limits;
- limits.min = 0;
- limits.max = 0;
- leftJoint.limits = limits;
- }
- if (Input.GetButton("INPUTPOURLADROITE")
- {
- JointLimits limits = rightJoint.limits;
- limits.min = 90;
- limits.max = 90;
- rightJoint.limits = limits;
- }
- else
- {
- JointLimits limits = rightJoint.limits;
- limits.min = 0;
- limits.max = 0;
- rightJoint.limits = limits;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement