Hello,
I’m sorry if my question is stupid or is unclear.
But I made a function allowing my character to be able to pick up a weapon and have it cling to him.
This function works and everything is fine. Except that when I try to move after my character obviously has small problems in his life.
I do not find where it comes from despite that I suspect that it comes from a collision problem.
(Don’t judge the HUD, I know it’s ugly but for now it’s just a prototype).
Thank you in advance and excuse me for my bad English, I am French.
And I’m a new user so I can’t upload attachments.
Yea, it is very likely an issue with collision. Just change the collision to “NoCollision” when you attach the gun, and activate collision again once you want to drop it.
A better way of doing it might be to create your own collision response type to something called “weapon” which will than have collision disabled for the player pawn or capsule or whatever you need.
- Go to Edit → Project Settings → Collision (Under Engine Tab)
- Create a new Object Channel and set the default response to “Block”
- Go to your character, select the mesh, go to the collision tab and set “Collision Response” for Weapon to “Ignore”
- Do the same for everything that might be interfering with the collision (E.g. player capsule)
Thank you very much for your answer. It was very helpful.