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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

First Person Controller (!RFPS) Getting stuck any colliders

Discussion in 'Physics' started by Wreck-Tangle-Games, Jun 5, 2015.

  1. Wreck-Tangle-Games

    Wreck-Tangle-Games

    Joined:
    May 27, 2015
    Posts:
    4
    Hi,

    first off, excuse me if I am posting this in the wrong section, could be scripting issue, physics issue, rigid body issue, I just don't know.

    I have spend hours trying to decipher this, but I cannot, so I now look to you fine people!

    Problem: I am using !RFPS asset, which may I say is brilliant all round, except for this one issue that I have had since the start of my project!

    When entering a collider, my player gets stuck! For example, I just created a key, you need the key to open a door. To pick up the key, I have scripted that when in collider, press E to pick up key. When entering the collider though, it does just that, collides, and does not let you in unless you jump a like a crazy person outside Walmart on black Friday. Same with the door, you have to be in the collider space for the door to know you're in it, but again, stuck. Please help? What have I missed?

    Thank you to all responders advance!

    Adam
     
  2. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    Im not exactly sure as to how you have things set up, or what your issue is.
    Is your issue that you are trying to go inside a collider, but the collider is just pushing you back?
    If so, you might be looking for "Is Trigger". On the collider, when is trigger is checked, it will no longer collide, however, it will still detect when an object has touched/entered it. You can use the OnTriggerEnter, OnTriggerStay, and/or OnTriggerExit method to see what touched the trigger.
     
  3. Wreck-Tangle-Games

    Wreck-Tangle-Games

    Joined:
    May 27, 2015
    Posts:
    4
    Hello, thank you for the quick response.

    Yes, the issue you stated is exactly right. I am trying to go inside a collider, for example, for a door to open automatically, but it is pushing me back. It is set to 'Is Trigger' yet still does not allow me entry?
    My player has colliders also, do these need to be set as 'Is Trigger' also, or not?

    It's a really strange issue, tried all I can think of, that why I feel it might actually be something on the !RFPS. I've just written to the developers of the asset to see if they have any answers.
     
  4. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    For debug purposes, make a new scene, place your player on a flat plane so it has something to walk on and create a cube and set it to is trigger.
    Does the player still not go inside?
    If so than the issue might be that your player is doing a raycast checking for collider's and preventing itself from going inside even if its a trigger collider.
    If not than there's something wrong with your other scene. Perhaps the door has a door handle with a collider on it that you forgot to set to is trigger. Or maybe you have a script somewhere that is making your collider's non triggers.