Need help with holding object clipping through walls

I’m trying to make a dusty trip fan game, but I’m stuck on making that the part your character is holding can still collide with other parts such as walls and floors.

For example, this is what I want to achieve:

This is what I have done so far:

External Media

Notice how the part I’m holding clips through walls in this clip.

I have tried multiple constraints such as RopeConstraints and WeldConstraints to try to get the held object to collide with other things, but they always turned out glitchy or behaved very weirdly. I also used force objects like LineForce, but they always made the object wobbly (I’m not sure if I have to tune it to reduce that or make it stop). I have searched through every support topic on the DevForum about things for dusty trip but haven’t found anything related to my issue. If someone could figure it out that would be great, especially since there are no other topics about this.

Code if needed to solve this is provided below.
(my problem is solved, code removed to prevent code theft)

I feel that WeldConstraints might be your go-to here, because I can’t think of anything else, how does it glitch when using WeldConstraints?

1 Like

Whenever I grabbed something, I positioned the part where it would normally go then weld it, but the part immediately flies and glitches out the map.
https://streamable.com/dosohe

1 Like

did you try making a fake hitbox on the object and adding it to the collisions with the physic service or wtv its called

1 Like

No, the only thing I’ve been testing for collisions was by setting the parts CanCollide property on both the client and server while testing different constraints.

Update: I’ve found that a similar game, a snowy trip, also has a grab system and lets objects collide with other parts. It doesn’t seem to be a weld, but some type of force. I forgot to mention in my original post I also tried things like LineForces, but they didn’t get the behavior I want (the object kept wobbling and shaking)

Video:

External Media
1 Like

i coded a similar system for Burger Game that essentially does what you’re attempting. basically i use BodyPositions and BodyGyros to orient the part and move it. using CFrames obviously doesn’t account for collisions and you COULD detect collisions via rays/touched events but its wildly inefficient. you already have the position that you wish your part to adhere to, instead of Anchoring the part and CFraming it you, could put BodyGyros and BodyPositions in the part, give ownership to the player controlling it and on their client have them move it around in accordance to their camera CFrame

2 Likes

Surprisingly, it works! It doesn’t really behave what I would have wanted, however it solved my initial problem! I think I’ll be able to tune it to my needs. Instead of anchoring it and CFraming it I allowed the constraints to align my object with the end of my arm. No raycasting and such necessary as it already works great! I don’t have much experience with the force constraints you said, which is why I couldn’t initially solve it myself, but thanks for suggesting to use them!

np my man, if you want the arm CFrame to attach more to the arm, you could also instead of taking the end goal CFrame, make it look towards where the object currently is as with bodymovers they don’t really snap into place like CFrames

Planning to do that, thanks again