1
\$\begingroup\$

I try to made a little skate game prototype in Unity 5 and I just encountered an issue. I added a hinge joint between the board and each of the wheels couples (front and behind) so the board can move forward. My problem is that when I try to rotate a wheels couple around the red axis (see picture below), the hinge joint seems to hindered the rotation, however I'm not sure. Is someone see how to do the trick ?

Here is a sample of my source code (0 index is the front couple of wheels, 1 is the behind) :

private void Turn(float hAxis) {
        wheelsTransform[0].Rotate (wheelsTransform[0].right * hAxis * turnAngle * Time.deltaTime, Space.Self);
        wheelsTransform[1].Rotate (wheelsTransform[1].right * hAxis * -turnAngle * Time.deltaTime, Space.Self);
    }

Thanks in advance !

The wheels are joined to the board

\$\endgroup\$
  • \$\begingroup\$ Can you post an image of your HingeJoint setup? Also if you want rotation I recommend you to have a look at Spring Joint \$\endgroup\$ – EvilTak Jun 27 '15 at 19:14
  • \$\begingroup\$ @EvilTak Thanks for the tip, I finally found an other approach which is to use WheelCollider (easier). However it's still difficult for me to parameterize the component :/ \$\endgroup\$ – Ant0nin Jul 1 '15 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.