Hello every one! So i’m in the middle of an car-game that are using the vehicle wrapper for the cars. problem is that the wheels of the cars sometimes (quit often) “bugging” through the ground. sometimes this leads to the whole care going through the ground, and obviously that is an big problem. I know allot of ppl have been having this problem before me, but I can’t find any solution on the problem.
I know that the wheels collision is detected by an ray in in the z-axie, is there any way to increasing the sensitivity on this ray? or are there any other way to increase the precision of the wheel calculation so that they stop going through the ground.
also don’t give me any suggestions on using 6-dof instead, I’m stuck whit the vehicle wrapper, and aside from this problem i kinda like it.
Cast a ray down, if the ground gets closer then the distance from the car to the bottom of the wheel, move it back up that distance, (at each wheel corner)
I guess that this can be done, but It will likely only open up for just an other sets of rays to fail in detecting the ground. (as the wheels already are rays). so it’s not the kind of solution that i’m locking for, but thanks for posting an answer!
The best you could perhaps do is try to increase the number of physics substeps. Otherwise, between the 6DOF bugs and the fact that the vehicle wrapper has seen little in the way of updating or maintenance, you might have to either script a vehicle relations system yourself or use another engine.
It used to be possible to have decent vehicles in the BGE using 6DOF at least, but the fact that none of the current developers know a lot about physics code means it could be years if such bugs ever get fixed.
Well the speed of the vehicle setting the length of the Ray is checking 1 frame ahead of the car in the future you have change the angle of the ray for speed and deviate the next frame
take the cars velocity, use this to find where the car should be the next frame,
check to see where the car should be, put it there, next frame, then on that frame check where it goes the next frame… and so on, is the only way I can be certain you won’t have issues.
I have heard about using object.suspendDynamics object.restoreDynamics in a single frame after moving it as a hack, but I don’t know if it applies here,
It’s just a guess though but are there any “collision masks” set up in your car? If you do, you might try to stop using them and instead re-enable all collisions and see if it fix it? I faced a similar problem before and the bug from the mask seems to be the cause, hope it helps.
I have found that if you have a “height” value for the suspension that isn’t 0, it tends to bug out more. So try setting your height to 0 (or really low)
this method looks similar to the one that are already in use by the vehicle wrapper, and the one i currently having issues whit. I thing implementing this one in python would make the wrapper useless, as there would be 2 modules doing the same thing, at the same time. I would like to move the care using the functions that already exist and not implement new methods as this should not be needed when they already exists. it would also be difficult (and heavy) to calculate the cars position on surfaces that ain’t flat. I’m locking for an method or fix to be able to use the already implemented wrapper, not to implement it on my own in python… but thx for your suggestions ;D