Instantiating a prefab with SetParent does not move physics colliders from originating transform

Appears to have been reported before, but was closed:

If something with a box collider is instantiated, then SetParent is called with worldPositionStays = false, then the collider will not get moved until you either

  • Move it in the editor
  • Enable / disable either the collider or isTrigger
  • Move the collider

It will appear to have moved, and the gizmo in the editor is in the correct spot, but collisions / triggers will not get called there but instead where the collider was before SetParent was called
I have had to add a coroutine to my main trigger component to make the triggers work:

private IEnumerator<float> _FixTriggers() {
      yield return Timing.WaitForOneFrame;

      Vector3 fakePos = gameObject.transform.position;
      fakePos.x += 0.0001f;
      gameObject.transform.position = fakePos;
      fakePos.x -= 0.0001f;
      gameObject.transform.position = fakePos;
    }

This has happened on 2018.2 betas 6, 7, 8, 9, 10, and the release candidate.

Thanks for your report!
The issue you referenced was closed because QA was not able to reproduce it with the available information. If you found a way to reproduce this consistently I advise you to submit a new bug report for it. Posting on the forum should always be secondary to submitting a bug report. Submitting what you wrote here would be sufficient. If you want to go the extra mile, adding a minimal reproduction project to your report would be a huge help and speed up the resolution process significantly. If you submit a bug report and want to raise awareness of the issue on the forums, please make sure to reference the Issue ID of your report.

Edit:

We had a go at it, but weren’t able to repro. Your description is missing some info about what the instantiated collider is supposed to be doing before it’s moved.