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

Box Collider on Spring Joint Randomly Stops Working in Editor and Builds

Discussion in 'Physics' started by HydraulicKangarooJay, Nov 7, 2020.

  1. HydraulicKangarooJay

    HydraulicKangarooJay

    Joined:
    Feb 25, 2020
    Posts:
    1
    Hello,
    some friends and I have been working on a game for a while, but there's this one bug that's been annoying me for months. In our game, we have elevators that are activated by running the player into a button mounted on the wall. The button is a box collider with a dampened spring joint to set it back to its default position after being pressed. The press is detected by a trigger behind the button that detects when the box collider has been pushed in far enough. Sometimes, however, the box collider that collides with the player on the button just stops working. This happens both in the editor and in the build. If I'm in the editor I can fix it by turning the box collider off and on again. I've tried everything I can think of, but just can't seem to figure out what is causing this. I recently recorded the gameplay after the button stopped colliding, which I posted to Youtube:
    .

    The layout of the button and triggers:

    For clarification, it is only the button plate's collider that stops working, I assume the trigger works fine. The only script acting on the box collider in question is the ButtonToElevator script, which is attached to the gameObject with the trigger collider. It simply communicated with the main elevator scripts through OnTriggerEnter.

    Any ideas as to what may be causing this would be greatly appreciated.
     
  2. d2clon

    d2clon

    Joined:
    Aug 19, 2017
    Posts:
    19
    Same problem here, in the moment I activate my SpringJoint2D the colliders stop working :/