how to make grabbed phys object not clip through a wall?

Hi, I made it that I can pickup physic objects with E but I can easily drag them through the walls, how do I fix that?




Sorry for all the mess, I do not know how to organize it well.

1 Like

This topic has been moved from International to Programming & Scripting.

When posting, please review the categories to ensure your topic is posted in the most relevant space. While I personally don’t have the answer to your question, hopefully, this new category will help to catch the attention of a more experienced forum member :slight_smile:

Good luck and happy developing in the meantime!

1 Like

Alright, sorry for adding a wrong tag it will not happen again.

1 Like

Absolutely no worries. That’s what I’m here for (and even I use the wrong category sometimes…). :joy:

Good luck with finding a solution and if you need anything from your friendly neighborhood moderator, feel free to give me a poke!

1 Like

I think you’ll get best results by setting up physics-based grabbing and letting the physics engine handle collisions.

Here is an example physics-based spring arm component, which you can attach to the camera component in Character BP. Then you can virtually attach any physics object to it.


Custom scene component BP - the component provides attachment and detachment functions, it backups and modifies a few physics properties to feel better while carrying around (gravity, damping), and applies physics on tick to maintain object at a target distance.


Character setup - I added an overlapper capsule to detect grabbable objects in range, and a physics spring arm (the new component) with some sound defaut values :


Character BP - (overly) simplistic setup to grab object in range when pressing E :


6 Likes

omg thx so much thats so genius to add a capsule to detect objects in range I would have never done that.

is the attatchedcomp a actor or?

it’s a PrimitiveComponent reference

Just what I need for my game, Thank you so much! :grin:

PhysicsSpringArm.uasset (175.3 KB)
code for the component(ue5.2) if anybody is lazy like me
(edit:2023/8/19 just found out uassets don’t work in certain places(file path is wrong etc. ))

1 Like

Hi!I solved this easy. Named the main bone in my skeleton (like here “Handle”)
In GrabComponent Blueprint added some nodes like on the picture.

Hi! Just enable “Use CCD” in Details/Collision/Advanced of the captured object.

3 Likes