Mesh collider with wheel colliders - Car

so we want to combine the Mesh collider (from car body model) with wheel colliders (from wheel model)
so as a whole detect colision car mesh to collision box of city model as road
I generally mean mesh to box
we have currently this mesh collider


and the wheel colliders

so if this idea should work or we must try anything similar to this, appreciate for any hints

We’d essentially like to find a way to split the road into a bunch of box collisions if possible. This is mainly because the mesh collider on the car runs afr smoother, and doing it this way would solve a lot of issues.

Don’t you think using mesh collider will effect the fps of game? i guess you should use dynamic rigid body created at runtime using Ammo.js It will be more efficient in term of fps and also collision handling would become easier then combining mesh and box collider.

1 Like

Agreed, it would affect the FPS. But the problem we had before was very erratic movement when we tried what you had suggested.

1 Like

I’m afraid you can’t have a dynamic mesh collider or at least you can’t have mesh/mesh collision AFAIK. Consider using compound rigidbodies for the body of the car: https://developer.playcanvas.com/en/tutorials/compound-physics-shapes/

I didn’t mean mesh to mesh collision (so car to wheel colliders)
but wheel colliders to box, so mesh to box

I’m assuming you would want the body of the car to collide with the road and buildings. Aren’t they meshes in your application?

the body of car with road and walls

The wheels should really be cylinders.

If the road and the walls are part of a mesh collider then I think you are going to have problems with mesh to mesh collision

That’s what I had asked. Is it possible to have them as multiple boxes instead? That’s the idea we had…

We want to put box collider in place where road model is
so it will be mesh to box (wheel colliders to road)

I thought the road wasn’t level?

So that’s why we’d like to split it into several boxes.

Unless there’s an alternative for mesh to mesh collision…

Is it an idea to link cylinder colliders with script to the wheels? And yes, I think you can use box colliders for the road.

I don’t really understand why a mesh collider doesn’t work. Would you like to explain that @yaustar?

I think it’s a limitation of Ammo.js/Bullet where mesh to mesh collision aren’t supported. This is running from memory though so that could have changed since I’ve last looked at it.

I normally run along the rule that anything dynamic should be a primitive or compound of primitives and static meshes.

2 Likes

Will has been working on a physics vehicle demo that still needs a little tweaking but looks pretty good already.

https://playcanvas.com/project/643289/overview/vehicle-physics

3 Likes

@will I try to implement vehicle physics
https://playcanvas.com/editor/scene/933948
but the car is bouncing from the plane
and I dont know is this connection point issue (probably yes) or other, want some hint
also when I change to kinematic and again to dynamic the car sits on the plane but I cant drive the car dont know what to fix to get it work