Forum Discussion

xTravyDx's avatar
xTravyDx
Member
10 months ago

Collision of interactive objects...

Looking to fix or figure out the following..

1.Players don't collide with grabbable objects.

2.Objects like tubes switch to a box collider if they're interactive.. Not allowing for other objects to go inside of the tube. 

3.Some objects with motion don't detect collision. Ex a grabbable ball with physics does but a remote control car does not. Even with a basic box collider attached.

3 Replies

  • 1) They do cause collision events for scripting collision detection, and they do stop player hands movement when configured in the Player settings, but they don't stop player movement. 

    2) Horizon uses a Hull collider for interactive objects. To change this behavior you can use an invisible collider to cover the outer part of the concave object.

    3) Switch the object to physics and then change it back to the prior configuration. Also, change the setting "Collision Events From" under the More tab to detect collision from Players, tagged objects or both.

    • xTravyDx's avatar
      xTravyDx
      Member

      1. Ok so your saying I just have to write a script to override it? Player movement is already configured in player settings. And you lost me with they last part. They do or don't stop player movement? Simplifiy if I had a basic slide I'd like a player to be able to move it anywhere they want and still be able to slide down without falling through. 

      2. And yes the hull collider is basically the object simplified to a box collider. Does adding the 'invisible collider' replace the hull? Either way if it's an option i just want the regular mesh collider on it that it had before making it interactive. I understand the purpose of the simplification. The more complex the mesh +velocity ect. The less chance to detect Collison. I'm aware but my use case is simple and wouldn't have the issue that standard mesh would be perfect.

      3. Haven't tried tagging objects good thinking. And the toggle back and forth from physics sounds ridiculous but wouldn't surprise me if that works with horizon lol thanks I'll give it shot!

      • PigeonNo12's avatar
        PigeonNo12
        Partner

        I edited my answer, I omitted an important word: hands. Grabbable objects can collide with hands when hands collision is configured in the Player Settings (build menu). Here's a raw demo following the slider example:

          https://drive.google.com/file/d/1Rk3ZfsqfJviOe76G47GE7DBLAkax9myT/view?usp=sharing

        The key on this example is Lerp. When the collision occurs, I'm calculating how far that collision is from the start of the sliding bar, and if the collision point is between the start and end positions of the slider (using dot product). Then the indicator is moved to the lerp vector using an alpha value.