Hey,
I’ve been struggling with Rapier errors as of today when loading prefabs with colliders attached.
Here’s the bug report:
opened 03:51PM - 23 Nov 23 UTC
closed 04:40PM - 23 Nov 23 UTC
bug
### Describe the bug 💬
Getting runtime errors lately using NE 3.25.3, not sure … at which version this actually broke but I started noticing it today when running a scene which loads prefabs/glbs with collider components.
Scene loads several (15-20) npc different prefabs with animator animations using:
```
async awake() {
await this.prefabObject?.instantiate(this.gameObject);
}
```
I sort of verified that it was the NE version causing this by reverting to a commit I did 14 days ago when I know things were working fine and doing a complete reinstall + export which gave me the same issue.
Console output:
```
debug_overlay.ts:23 Error creating collider "HansA"
Error: Error: recursive use of an object detected which would lead to unsafe aliasing in rust
at I3.wbg.__wbindgen_throw (rapier_wasm3d.js:4504:15)
at 00527bbe:0x139b1b
at 00527bbe:0x139b37
at 00527bbe:0xe2e4f
at H.createCollider (rapier_wasm3d.js:932:18)
at MI.createCollider (collider_set.ts:79:31)
at sI.createCollider (world.ts:342:31)
at _RapierPhysics.createCollider (engine_physics_rapier.ts:760:36)
at _RapierPhysics.addBoxCollider (engine_physics_rapier.ts:534:14)
at BoxCollider.onEnable (Collider.ts:101:38)
```
Could it have been caused by the recent performance improvement in 3.25.3? I'm not really a web developer so I don't know how to revert to previous NE runtime versions and verify.
### Operating System 👩💻
Windows, Android (mobile)
### What browsers are you seeing the problem on? 🏄♂️
Chrome
### Editor Version 🎲
2022.x
### Needle Exporter version
3.25.3 and 3.21.2
### Project Info (Unity only) 📜
_No response_
### Steps to reproduce 🔢
```bash
1. instantiate prefab object with collider attached using
async awake() {
await this.prefabObject?.instantiate(this.gameObject);
}
2. Sometimes I had to load several objects this way to repro the issue.
Hope this helps.
```
### Reproduction ♻
_No response_
### Discord or Discussion link
_No response_
### Validations 🩹
- [X] Follow our [Code of Conduct](https://github.com/needle-tools/needle-engine-support/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [docs](https://docs.needle.tools).
- [X] Check that there isn't [already an issue](https://github.com/needle-tools/needle-engine-support/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Needle-Engine-specific issue. For example if it's a Unity related bug, it should be reported to [Unity](https://unity3d.com/unity/qa/bug-reporting) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/needle-tools/needle-engine-support/discussions) or join our [Discord Chat Server](https://discord.needle.tools).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Original Post on Discord
by user 427134081860501507
marcel
(marwi)
November 23, 2023, 12:00am
2
Hi, I’ve just replied there and I believe the latest release should fix this. Would be great if you could update (it got released a second ago)
Thanks, I’ll give it a try🙂
by user 427134081860501507
3.25.4 seems fix to it. Thanks @marcel
I just replied the same to the report.
by user 427134081860501507
marcel
(marwi)
November 24, 2023, 12:00am
6
Great ! Thanks for reporting
Ok so one quick observation, looks like some colliders now gets the wrong world position, looks a bit random which collider gets affected. Pretty sure this is a recent regression.
by user 427134081860501507
marcel
(marwi)
November 24, 2023, 12:00am
8
Hi, if you could send a repro of this for cases where it happens it would be great
Here you go
opened 08:03AM - 24 Nov 23 UTC
closed 10:50AM - 04 Dec 23 UTC
bug
### Describe the bug 💬
Colliders end up in the wrong location. Seems to be rela… ted with parent rotation.
### Operating System 👩💻
Windows
### What browsers are you seeing the problem on? 🏄♂️
Chrome
### Editor Version 🎲
2022.x
### Needle Exporter version
3.24.0
### Project Info (Unity only) 📜
_No response_
### Steps to reproduce 🔢
```bash
1. Import package, setup scene with Needle
2. Add &showColliders url param to scene url.
3. Collider does not have the right position
```
### Reproduction ♻
[ColliderCenterOffsetBug.zip](https://github.com/needle-tools/needle-engine-support/files/13456522/ColliderCenterOffsetBug.zip)
### Discord or Discussion link
_No response_
### Validations 🩹
- [X] Follow our [Code of Conduct](https://github.com/needle-tools/needle-engine-support/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [docs](https://docs.needle.tools).
- [X] Check that there isn't [already an issue](https://github.com/needle-tools/needle-engine-support/issues) that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Needle-Engine-specific issue. For example if it's a Unity related bug, it should be reported to [Unity](https://unity3d.com/unity/qa/bug-reporting) instead.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/needle-tools/needle-engine-support/discussions) or join our [Discord Chat Server](https://discord.needle.tools).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
by user 427134081860501507
marcel
(marwi)
November 24, 2023, 12:00am
10
Hi sorry if i wasnt clear but you can simply send bugreports including all necessary files (only what’s used in the current scene + the web project) privately to our servers using this menu item:
marcel
(marwi)
November 24, 2023, 12:00am
11
For future reference that’s much easier
marcel
(marwi)
November 24, 2023, 12:00am
12
we also log an issue for those internally so it’s already tracked then. But thanks for the scene!
marcel
(marwi)
November 24, 2023, 12:00am
13
Should be fixed in the next update - I’ll add your scene to our test scenes and verify I didnt break anything else
Yeah I remember having read that now🤦♂️ thanks
by user 427134081860501507
Do you have test scenes for colliders with trigger behaviors as well? I’m seeing a lot of trigger events not working as expected in my scenes atm.
by user 427134081860501507
marcel
(marwi)
November 24, 2023, 12:00am
16
Yes the scene has both - could it be because of colliders not being at the right position?
marcel
(marwi)
November 24, 2023, 12:00am
17
It could be caused by the change to not create physics rigidbodies implictly anymore if the collider doesnt have one in Unity. I’ll double check
Yeah, I checked where the colliders were positioned, that’s sort of how I saw that some of them has wrong offsets. But even when entering them no trigger event happened.
by user 427134081860501507
marcel
(marwi)
November 24, 2023, 12:00am
19
How do you receive the events? I have a little test scene here with a collider set to trigger, no rigidbody, this one receives the onTriggerEnter event