Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How do i rotate a turnstyle door 360 degrees when player is against the turnstyle?

Discussion in 'Physics' started by john750411, May 8, 2023.

  1. john750411

    john750411

    Joined:
    Jan 13, 2022
    Posts:
    5

    How can i make the turnstyle part rotate when i go through the turnstyle??. See attached image.
     

    Attached Files:

  2. DouglasPotesta

    DouglasPotesta

    Joined:
    Nov 6, 2014
    Posts:
    108
    Your probably better off avoiding physics for this.
    If you are super into the idea of using physics then you will want to set the rigidbody location to be fixed in all axis using the constraints, and only allow rotation only on the axis you want it to rotate around. You can set the drag and weight to give it the feeling you want. You will probably want the bounciness on the physics material to be 0 so that it more consistently moves with the player as they push against it.
     
  3. john750411

    john750411

    Joined:
    Jan 13, 2022
    Posts:
    5
    thnx , but i solved the problem . Its an automatic type turnstyle where you have to press a button now to make the turnstyle turn . way easier than to deal with physics .
     
    DouglasPotesta likes this.