PINBALL QUEST: ‘Left And Right’ - Solutions

Quest: Pinball
Challenge: Left And Right

Feel free to share your solutions, ideas and creations below. If you get stuck, you can find some ideas here for completing this challenge.

So I was wondering how to get the left flipper to actually work. I’m out of ideas.

If i remember I copied the right one, then spent ages adjusting the hinge joint and the z rotation

@davidwindsands
see my solution on the “Flippin’ Heck” thread.

public class Flipper : MonoBehaviour
{
    // configs
    [SerializeField] KeyCode keyMapping;

    // cache
    HingeJoint2D joint;

    // Unity messages
    void Awake()
    {
        joint = GetComponent<HingeJoint2D>();
    }

    void Update()
    {
        if (Input.GetKey(keyMapping))
        {
            joint.useMotor = true;
        }
        else
        {
            joint.useMotor = false;
        }
    }
}
1 Like

Do you put this on both paddles & therefore control the paddle from the controller?