NullEngine server OnIntersectionEnterTrigger not working

Running the following playground on a server with NullEngine doesn’t log anything while in the playground it does with both Engine and NullEngine.
https://www.babylonjs-playground.com/#JS3GCM
My 2 cents on this is that somehow, on the server, OnIntersectionEnterTrigger is not triggered.
I logged the position of the moving parts and they do get updated.
I think it’s related to: Collisions for some 'moved' meshes are not detected with the Null Engine but that one didn’t give any useful insights either.

1 Like

Pinging @RaananW our collision master :slight_smile: and as he looked the other thread so he might have a bit more insights.

We have two runtimes here - one is the browser, the other is (i guess) a node-js server. If I understand correctly, when running in the browser with a null engine, it does work correctly, but on a node server it doesn’t. It is always possible that those two engines will run code a bit differently, but the end-result should always be the same. How do you make sure that the code is exactly the same?

Are the spheres even moving on the node.js server? can you log the state of the scene after 10 seconds, export it and load it in the browser? Can you make sure the scene is running correctly? This could be an issue with the physics engine as well.

1 Like

I logged the positions of the spheres on enter frame and they do move. Is just that they don’t stop moving. The z position increases without stopping like the boundaries aren’t even there. The collision detection is for when the first sphere touches the end boundary and it seems that on node js it goes through it

@RaananW I added a log for one of the spheres here
https://www.babylonjs-playground.com/#JS3GCM#3
On the server, the z doesn’t stop increasing :pray:

This is the result of the demo you pasted running in locally in nodejs:

I do get a winner, and it is the same values as in the playground. But there seems to be an exception thrown right after

1 Like

I turns out that I was using PhysicsImpostor.PlaneImpostor for ground on my server and that was causing the ball to jump over the fence. I still don’t know why though. It works now.
Cheers mate. Give me your address and I’ll send you a beer.

1 Like