I’m working on the drop weapon system in my FPS game, Which works other than the gravity portion of my weapon once It is detached from my player arms mesh.
In my level I have all my gun BP’s and when i begin play they all fall to the ground as intended.
I of course had to disable physics for the 2 guns I spawn in my hands to avoid colliding issues with my player. Once I drop them the gun just floats in the air despite having enable the physics again.
KUDOS to you for making such an informative video about your issue, seriously. I can’t ask for much more.
So what I would do if this were me: After the detachment and Simulate Physics== True, give it a little launch, a little impulse, something to make it move. If it doesn’t arc, but DOES move with a physics based push, it’s gravity that’s your issue. If that’s the case you may need to ensure that the actor is affected by gravity using a toggle there for it!
Thats a good idea to add impulse, dont you need a physics asset for that though?, i didnt mention in the video but the assets for the guns are basic af, just a static mesh. Not rigged at all. No physics asset. I had to put a box collison in the BP just to make the other BPs fall to the ground. I did ensure that gravity was enable on both the placed BPs and the spawned ones. Im scratching my head here as this should theoretically work
You SHOULDN’T need a physics asset for that- See the blue boxes in the base level, I don’t think they have one. If you’re giving them collision and mass as far as I know that should be enough. Failing that, you could try giving them collision with pawn on top of that and try to push them with your character.
Also, it’s not too bad to just make a single physics asset if you wanted to do that and throw it on all of them.
So, i fooled around with it some more, I havent added the impulse yet.
But its absolutely wack, I removed the collision on the gun static mesh, set the collision enabled to no collision and disabled sim physics. I tick block for pawn on my box collison just for fun (which shouldn’t work at all) and my guns are fighting my player for space and I cant control him.
I verified that every component in my BP are set to no collision including the box. So this should not be happening.
Perhaps ill continue with picking up the weapon and that weapon will give the old one the Impulse bump you were talking about to fall to the ground. But if I have block pawn enabled then weird things happen
Even if you detach the weapon, it is still your characters component.
Maybe it would be better to attach an actor gun to one of your characters component.
It’s not a component, it’s an actor being attached to a point on the skeletal mesh, right?
And you made sure your skeletal mesh has NO collision, all ignore, on each gun, correct?
Interesting that it fights, definitely acting as if it’s got collision, but not physics as the character would push it away. So the issue is that physics IS active when you start the game, but upon deactivation from being picked up it won’t RE-activate. Do try to re-enable gravity, and look into making a physics asset that can be used across all of them- a simple box would do, probably.
Yes that is correct its a blueprint actor (weapon) attaching to the socket of My arms mesh of my player character.
Ill try out the enabling gravity. All the weapons are children of the WeaponClass blueprint and in the parent I’ve set no collision on the skeletal mesh and all its children (attachment static meshes)
Take care of this! The settings only cascade if you don’t set them differently in a child. So if you have a specific weapon that is the issue, make sure that specific one is set to use class defaults!
So just for fun I reset the class defaults as Mind Brain Suggested, No change,
This floating weapon thing happens with both weapons that I’ve spawned in. I’m going to continue and script my pickup logic so I can see that if a gun is already spawned into the world and I pick it up if there is any change.
I tried added both an enable gravity and add impulse node and both did nothing.
I found a box collision on the static mesh of the weapons, which I assume UE generated after import. I deleted that and changed the collision settings in the static mesh to no collision. but it will still fight with my player when there is no collision enabled… I’ll just leave it set to overlap for now. There must be some other hidden collision somewhere, I’ll check the other static meshes for the attachments.