Issues with Tool Welding System

Trying to script a tool grabbing system. When the player presses F to equip the tool, it welds the tool’s attachment to the attachment on the player’s hand.

Previously have tried using AlignPosition and AlignOrientation, as well as BallSocketConstraint. These worked really well, besides the fact that if the player jumps, they get flung a tiny bit like in gyazo gif below. It works especially well for when the tool gets pushed into the wall/floor, as seen in the first video, which is the intended effect.

Also tried using Motor6d welds, but when you move a long tool into the ground or a wall, it lifts/pushes the player’s character rather than moving the tool out of the way.

Trying to find a way to do what the AlignPosition & AlignOrientation did, but without the jumping glitch.

https://gyazo.com/ddb21b08c1b2b55a9a94364acfa17938

By jumping glitch do you mean the tilt of the player or the way the tool tilts downward?
Is the tool Massless property true? Parts with Mass can affect player physics.

1 Like

Hey! Yes, the tilt of the player when jumping at the beginning is what I am talking about, not the tool. I have previously tried setting massless to true and still no fix…it did not seem to change anything.

It’s probably the physics related to the position and orientation Align tools.
Try experimenting with all the combinations of properties in the AlignPosition. Maybe make ApplyAtCenterOfMass false, or increase MaxVelocity so that there’s no lag when the Attachments move in relation to each other.
If that still doesn’t work another thing to try is to add a small upwards force to the tool when jumping.

1 Like

We have tried adjusting all of the meaningful combinations in of the properties in AlignPosition, but none of it seems to fix the jumping glitch, unfortunately. I feel like adding an upwards force to the tool would be inconsistent and might cause the issue to be even more apparent, but will try it and get back with you tomorrow. Thank you for the help so far!

maybe add the force to the hand Attachment, not the tool. It might help push the arm up and keep the player level(ish)?

1 Like

Hey! Sorry for just getting back with you on this. We tried adding a force to the hand attachment, but that really only mitigated the issue a bit. Unfortunately, it is still very apparent and would need some other type of fix.

Finally found a fix! It seems like you have to set the density of the object to 0.0001. Massless did not really do much, but density is where the issue was. Thanks for the help!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.