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.