Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Struggling to Create Foosball Physics

Discussion in 'Physics' started by HarrisonMcIntyre, Nov 13, 2020.

  1. HarrisonMcIntyre


    Nov 12, 2020
    I'm completely new to the world of Unity, and I'm trying to do something that I feel should be fairly simple, but I can't for the life of me figure out. I'm trying to create an interactive Foosball table, which requires rods with players on them to be able to move back and forth, as well as rotate to specific angles (i.e. rotate quickly to 45 degrees, then return to an upright position). But every time I try to rotate the player rod, I run into problems, like the rotation being in world coordinates instead of relative coordinates, or the rod rotating unpredictable amounts not corresponding to the angle I input as the target angle.

    I realize none of this information is very specific, but I've spent the last 2 days combing through Unity's documentation, and I've yet to find a simple explanation of how to interactively rotate an object about an axis to a specified angle (during simulation of course). I'm really just looking for someone to point me in the right direction.