How to create a physics drag

So i’ve been working on some odm gear, and i’ve ran into an issue.
The gear goes straight ahead without any weight at all, and i would like it to have a physics effect where it does not just go straight to the point and has some drag.
This is it as of right now:

1 Like

Try using a VectorForce to apply a force in the opposite direction of movement. You might also want to add some additional force to the y axis to imitate gravity.

If you don’t already know the direction of movement, you could try:

local drag = 500
local dir = ((char.PrimaryPart.Position + char.PrimaryPart.AssemblyLinearVelocity) - char.PrimaryPart.Position).Unit
VectorForce.Force = -dir * drag

I advise you to enable ApplyAtCenterOfMass and set RelativeTo to Attachment0. However, you may need to change some of these values on a case-by-case basis.

Your game looks fun so far, I hope this helps! :slight_smile:

1 Like

Thank you, i’ll try that right away. I was just trying out lineforce and it has a nice drag but the velocity you need to add along with it ruins it. I’ll try that out

The vectorforce has no effect on the bodyvelocity.

i would like it to be impacted by gravity

The vector force should work as a separate force from the body velocity. The vector force should be inside the character and attached to the RootRigAttachment.

If you want it to be impacted by gravity you can do:

VectorForce.Force = -dir * drag + Vector3.new(0,-workspace.Gravity,0)

This is the same line of code, but with a Vec3 addition that takes the gravity and turns it into a downward force. You could also replace -workspace.Gravity with any negative number for custom gravity.

Could you share the code? This will better help in solving ur problem

ah, the root rig attachment. I created a new attachment not knowing of that. I’ll try it out

yessir

The module

the model is r6, and i cannot find a child named rootrigattachment.

It would be RootAttachment not RootRigAttachment sorry im a bit late.