I will attempt to explain my problem as best i can. I have an aircraft with retractable gears as bones. With the wheels parented to the gear bones…As running everything is fine. The craft acts like its supposed to. Sitting on its “wheels.”
When I manually move the gear in pose mode and play the game it still works fine and the plane rest on the wheels and will fall to their position and act right.
If anyone understands what im trying to accomplish and knows any tips. please help me out.
Heres the blend file. 2.66…hold W to retract gear. Edit: The plane should fall down but doesnt…if i turn on physics eval…the wheels collision boxes stay in the down position…i dont know why or how to fix.
It has something to do with compounding collision bounds. You have compound set on the wheels , and when I untick it, the bounding boxes for the wheels move, but since they are the child of a rigid body, it’s parent’s physics reactivity takes precedence. It does not seem like local movement and compound bounding boxes work together.
The only way I could get this to work is to use rigid body joint constraints to connect the landing gear to the plane. However, I have absolutely no idea how to actuate rigid body joints gracefully… so the end result is a bounding box that moves, but not in a good way.
Another option would be to work with shapekeys on the physics mesh and update the transformation. With this ‘No Sleeping’ has to be activated, else it won’t update properly. Here’s an example.
But I think, normally, if you would update the mesh of the wheels during the animation, it would also work.
Edit: I doesn’t work with an armature, so better use separate objects for the wheels.
But I think, normally, if you would update the mesh of the wheels during the animation on the bones, it would also work.
Thats what I thought at first, but the documentation clearly states that it does not work for compounded physics meshes (child or parent). Maybe if the plane is a single mesh, and instead of using shape keys you just armature deform the landing gear… then you could probably use reinstancePhysicsMesh().
Not that there is anything wrong with shape keys
*EDIT
Well nevermind… I don’t think armatures will work because of the parenting required in BGE. I keep forgetting that.
I’ve actually tried swapping the mesh for a total gearless mesh. And still shows the original mesh in the physics evaluation. :D. I have not tried that reinstance mesh. I will
This works. It isn’t completely perfect, and it required a little nudging to get the the plane above ground when the gear deploys, but the alternative is horribly inefficient.
I was bored and didn’t have the patience to wait for a response
@Hobomatic
your example works perfectly…I am ashamed to say I know nothing about shapekeys =( ive only done armature/bone stuff…but I must say it works exactly the way I would want it :D…and i see the little hiccup but its hardly noticable…i gotta learn shape keys now …thanks for the help…and let me know if you have any other ideas or any other angles
Nice idea to put the Property Sensor to ‘Changed’. This way no range has to be specified. However, I think you don’t need the nudge part. And updating the physics mesh every logic tic for such a small time won’t effect the performance as much. It’s much smoother by just enabling pulse mode on the GearMove Sensor. So I would recommend that.
@ superflip: I’ve appended your scene in a ‘clean’ blend, so the file is smaller.
@ raco & hobo. sorry for the late reply and the bump but i got around to messing with this again yesterday and your example was flawless…Using the shapekey collision mesh method and a landing gear with no collision i can get the result i want :D. In the video you can see the shapekey collision meshes updating.they only update every few seconds. here is my test.
I do have a followup question. my physics spikes horribly when i change my airplane mesh to triangle mesh. it like bounces all the time and snags on flat ground.