In my UE4 project you can pick up a gun(and attach it to the player’s mesh socket), shoot and drop it. I modeled a gun in Blender and it has 5 bones: Body, Trigger, Barrel, Bolt and magazine(the Body being the parent bone). I don’t want my guns floating in the air so I want them to simulate physics. Every gun is a child of BP_Weapon. The BP_Weapon has only a skeletal mesh. The mesh is set to “BlockAllDynamic” so i can pick it up using a line trace. If on “Begin play” I set my guns to simulate physics they work fine but the magazine is also moving on it’s own. I tried using “Set all bodies below simulate physics” and somehow ended up my magazine not showing up and the gun rotating while it’s floating in the air. How can I make the gun simulate physics but not the magazine?
I’m curious why you are using bones - You only really need bones if you want the components to move in relation to each other dynamically. It would be simpler to just make them all one static mesh except for the mag (if you want it removable) which could be another separate mesh.
I used that node just to try and see if it might help me in some way. I don’t know if this is relevant or not, but when I modeled the gun in blender I made the magazine removable. The trigger and the barrel are connected to the model. The way I did it was just extrude out of the body. Then I made the magazine and just joined it with the gun model.
I just want my gun to simulate physics, but when I use the “Set simulate physics” node, and I drop the gun the magazine is simulating physics just like the gun. It should not do that. It should stick to the gun.
I made the gun with the magazine a static mesh and I added it to the blueprint so that when the gun is dropped the skeletal mesh is not visible, but the static mesh is visible, will simulate physics and will have collision set to “BlockAllDynamic”, and when I pick it up, the skeletal mesh is visible, but the static mesh is not visible, it will stop simulating physics and will have no collision. It almost worked but when I would drop the gun it would go through the floor. Perhaps if I would set the skeletal mesh to have collision when I would drop the gun it might work.
I know I exagerated a lot with my genius “fix”. I might as well stick to the floating guns and just put them is some sort of gun lockers for the player to pick up.
Here is a bit of a hack. You could use the merge objects feature in blender to turn them into 2 different mesh. One with the Mag and one without. Then swap the mesh when the gun is loaded or unloaded.
I don’t want my gun to be in a loaded or unloaded state. I just want a simple reload animation when I press “R”.