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.
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
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;
}
}
}
Do you put this on both paddles & therefore control the paddle from the controller?
For the left paddle, I set the lower angle to the opposite value of the right flippers lower angle. Then, I needed to set Motor Speed to -10,000 and it worked.