Mesh with BoxImpostor won't fall-off the edge of another BoxImpostor

Hi there,

I’m having an issue getting a player mesh with boxImpostor to fall-off the edge of the ground mesh also with boxImpostor. I’m unable to reproduce in playground so I am stuck and need your help. The only way to test is through the site but a controller is needed. At this point, I believe it might be a bug. I ran a couple of tests but no dice. The player mesh doesn’t easily slide off as expected, if I hold on to the analogue stick, it hangs on the edge but falls off the moment I let go of the stick, thanks.

Adding @RaananW and @Cedric but as you might guess it may be difficult to help without a repro… Do you have a live link that demonstrates the problem, even if it’s not in the Playground?

As @Evgeni_Popov said, it is hard to understand the situation without some form of a demo. a screencast would be a start, but a playground will really help us understand the issue much better and maybe offer a way to fix it (or fix the bug if it really is one)

1 Like

Hi guys,

Below is the link as requested.
https://cocobunny.voxelcubes-games.com/
An account and a controller is required to test, apologies for the inconvenience.
But if you mind, I can send some screenshots instead, thanks.
Try running off the level as soon as it starts to test, the player just hangs.
One thing to also note, I’m using the code below to stop the player from rotating while moving in the renderLoop.

if (player) {
	player.rotationQuaternion.x = 0;
	player.rotationQuaternion.z = 0;
}

But I tested with the above code disabled and I still get the same issue.

First - this is so awesome that it is built with babylon!

Second - i tried without a controller (using the inspector).

Once you get to the edge, it seems to be working correctly. Note the constant rotation change (which as you mentioned is due to you forcing the quaternion to reset). Might it be code related to the controller movement? Are you forcing a position (y, specifically) in any place in the code?

It was great understanding the scene, but localizing the issue will require a scene with the minimum amount of clutter and a non-minified version of babylon. This is why we always recommend providing examples in the playground - we can really debug there

2 Likes

Thanks for taking some time to have a look @RaananW. So I have just done another test, I simply replaced the player with a Box and it works fine, I was able to smoothly move the box off the edge. It seems the issue is with the player mesh. I will try to isolate the issue a bit more then try to replicate the issue in the playground.

1 Like

Hi @RaananW, I managed to resolve it (Not the issue itself). Initially, the physics impostor was applied to the player mesh but now, I simply created a box mesh, set the box as parent to the player then applied the physics and logic directly to the box mesh.

In the end, I could not resolve the issue when physics is applied to the player mesh but what I have now works great. Gotta say, BabylonJS is awesome!!!. :slight_smile:

I will post on ( Demos and projects ) forum once the fix is done, thanks again!

2 Likes