i’ve got a really weird physics issue. I’ve got terrain mesh and fast moving block (just a cube) in a test level. The cube velocity is pretty high - speed/velocity vector length is about 160 - and on some points hes passing though the terrain object. Of course i know this happens sometimes, so i raised the physics iteration to 100 and both colliders use continuous/continuous dynamic collison. Terrain also has a kinematic rigidbody attached. And heres the funny point, i get a message the two objects are colliding. So why is the block still going through the terrain mesh and what can i do about it?
Greetz, the chicken
Edit: Oh and yes, i know my english is awful. Sorry for that
I dont know, didn’t have any more ideas and thought, maybe a kinematic rigidbody will help
I’m moving it by applying a force to the rigidbody when i press a key. whenever it hits another object, no more forces are applied to avoid that im the one pushing the object through the other collider.
As i said, yes i tried continous dynamic and it doesn’t help at all.
Range of the curve is between 0 and 1.
ForwardForce is 100 i guess.
And as i already mentioned, unity is even telling me the two objects do indeed collide. But the cube doesn’t stop. But for something like a racing game (thats what im prototyping right now) it sucks, if u just have velocities around 10 or something like that. Wouldn’t look fast at all.
Well, of course im doing this in fixed update. Otherwise that would be an obvious reason. I know, this kind of problem can occur. The only thing thats strange is, im writing it to console if the cube collides with another object. And he does, but its still going straight through it. Could it be possible, that this is because of the MeshCollider? Read somewhere it is like a pretty thin skin like collider, instead of a thick one (which would be what i need).
Btw thx alot for your help already
Right now they do, but it also happens with a box collider. Tried it already. I’d guess it really is, that physx can’t handle the velocity at this point. I don’t have any other explanation right now.
Maybe i’ll try to compansate it myself in a script somehow, because the OnCollisionEnter still gets called, so its probably the best way.
Don’t do mesh to mesh collisions, change that right away. You keep banging on about OnCollisionEnter still gets called, but I’m ignoring it because it 100% does not matter. Just because it collides it does not mean it is able to respond to it properly in the collision engine. Ignore that.
make sure you use a collision box not a collision mesh for the moving object. Don’t argue Later you can change it to a convex mesh if you wish but for now, make it a box collider.
Ensure the mass, bounce, friction etc are all at 1.0 for the sake of testing.
Does it occur when the object bounces or in any way responds to other collisions, or when you’re just using physics forces yourself? If it is from a bounce, its a separate issue.
does the terrain use extremely low polygons where it passes through? if it does, just subdivide it a bit in your modelling package and try again. This is because physx craps out on really large polygons.
Not particularly larger than any other polys in the mesh.
BUT 3. and
gave me an idea. Because indeed it doesn’t seem to happen now that i thought about it, without a force applied. So a simple trigger with small range, stopping the script from applying any force at all, or something similar might help. I’ll try it when im back in a few days.
Thx a lot for your help, even if its not the reason, you got me closer to the reason.
That seems like an awful workaround, I know unity for sure is able to fire all sorts of cubes at meshes without them going through - even really fast so I’m wondering whats set up wrong. I’m interested in this because my own game is heavily physics based. I have 4 simultaneous user-made worlds which rotate with 32 balls that must not fall through.
I generally have a big interest in physics, its great fun to mess with. I hope you get it sorted out. Trying to think why it’s behaving so odd for you.
I’ve tried the same thing again, but instead of the terrain i used a simple cube with a box collider. And i smashed my cube right through it, although i needed a way larger velocity (about 2500). So it seems my world is simply too big Solution would be, scaling everything down and adjust my forces i guess. Not quite sure if it will help at all.