trying to implement a “drop weapon” feature in my FPS, the weapon detaches well from my character, but it won’t simulate physics (trough i set it to) and just hang in the air where i last held it instead. any clues?
the above picture is shot after taking a walk around the pistol. it didn’t move, i did.
i’ve found out the collisions were set to “no collision”, and after enabling it the weapon oversimulates physics, it is falling trough hands even when it should stick to them (non dropped) and also breaks to parts (skeletal mesh fragments)
as a last resort you could make your weapon skeletal, instead of static, which would also give you the ability to animate it during reload or something, anyway, with skeletal mesh you could use " set all bodies below physics blend weight", instead of simulate physics.
Simulate physics doesn’t do crack for me either, not on meshes, not on main character, but the blending physics below some bone works all the time.
p.s.
Collision shouldn’t be something to change if you just want it to react to physics, unless you want to be like 100% sure to not have sticky fingers or something, having the player kick the weapon away during fall, which could again, be combated by simply setting weapon to ignore pawn collision channel instead of ignoring all collisions, but id guess since you’re wielding the weapon you’ve already have that figured.
You should not play with the default values of the gravity/physics, it’s always better tho change thos stuff specifically for an action.
In the weapon blueprint you should do only these SIMPLE things.
when Equipping;
Set Enable Gravity (With box not ticked, so it’s not enabled)
Attach Actor to Component
when Dequipping;
Set Enabled Gravity (With the box ticked this time, so it is enabled)
Detach Actor
.
It’s really that easy, and if you want or need the collison than add it as a step in Equipping and Dequipping, then use “Set Collision Enabled” in both steps, but changing the type of collision, to “No collision” when equipping/picking up, and your normal collision when dequipping/dropping.
well in my specific case, it wasn’t about the physics or gravity, turns out the reason was skeletal mesh parts, which were all somewhat set to “kinnetic”.
besides, if you disable the gravity but not physics when holding the gun, doesn’t it getting bugged out on every collision with other objects?
Yes, you need to disable physics to so it won’t interact with other objects. But the common reason for it not actually falling down is Gravity not being enabled. As you explain your situation wasn’t as ordinary as this problem is.
But if it were the ordinary problem with it just not falling down, setting gravity to enabled often resolves that.
Apart from correct collision responses, the object seemingly must also use simple collision. That was the biggest issue for me since I was too caught up to actually read my log, but as I changed the collision to simple, and added a few shapes to keep it from falling through the floor, automagically my dropped items began behaving! yes… luck.
I FIXED IT!
The Physics Simulations DOESNT WORK When You Have Per Poly Collision Enabled, Just Disable IT, THEN Set Physics Simulation to True, BRU! This Can be Done On The Enemy BP Itself, So Not Need To Leave The BP Your Trying To Edit, BRU! Thank God For That!