LinearVelocity constraint anchoring the player?

  1. What do you want to achieve?
    I currently had a system working where i can set a player to ragdoll and using wasd, VectorForces would push me around. The problem arises because VectorForces apply a constant force and so doesnt stop accelerating the player. So, I’ve tried using LinearVelocity constraints instead, as they have a target/max speed.

  2. What is the issue? I’ve tried implementing LinearVelocities by modifying my already working code (for VectorForces) but now instead of moving the player, it quite literally just anchors the attachment its applied to into place.

  3. What solutions have you tried so far? I’ve switched back and forth between the VectorForce and LinearVelocity but only the VectorForces work?? I’m still decently fresh to scripting let alone constraints so I have a feeling theres something in the LinearVelocity I’m forgetting to change.

The constraints are added to the character in a script inside of ServerScriptService, that I feel is the one with the problem. This is the script here:

local forceconstraintws = Instance.new("LinearVelocity")
forceconstraintws.MaxForce = 100
forceconstraintws.Parent = model
forceconstraintws.Name = "ForceConstraintWS"
forceconstraintws.Attachment0 = model.RightHand.RightWristRigAttachment
--forceconstraintwasd.Attachment0 = game.Workspace.TestTTTttttt.Attachment
forceconstraintws.Enabled = false
forceconstraintws.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
forceconstraintws.VelocityConstraintMode = Enum.VelocityConstraintMode.Line

it also doesnt work on that TestTTTttttt part by the way

The constraints are activated in a localscript, here:

-- W button down
ForceConstraintWS.Enabled = true
ForceConstraintWS.LineVelocity = 100
userinputservice.InputEnded:Connect(function(input,gmp)
	if input.KeyCode == Enum.KeyCode.W then
		ForceConstraintWS.Enabled = false
	end
end)

Please let me know what I should change and/or what else I should show in the scripts if needed.

1 Like

Bumping because its been 3 hours and no answer…

Bumping again; 5 hours now, still no response.

If there’s any lacking information in the original post I’ll be happy to send any.

10 hours??? Bumping again, can someone respond and/or tell me why nobody else is???

I have the exact same problem but instead of the player a part gets anchored. idk what to do

sorry for leaving your reply for 3 days, i didnt see it; its been 2 years and i’ve long since moved on from this project but sadly i looked over the old gamefile right now and it seems as though i ended up just using VectorForces for my usecase…

i’ll make this reply the solution as i dont think this post should still be open if i’ve moved on from the entire game this question was related to so i think it would be worth making your own post with more detail (your code, your physics constraint/s, etc.)

sorry that i couldnt give you the answer you were looking for but even looking over my code right now in the original post i dont see an issue with it so im still not entirely sure what was causing that :sweat_smile: maybe it was an issue with networking? (localscript/script trying to access the physics constraint but not having network ownership so the changes dont apply)

nah i dont think the network ownership was a problem, i also just gave up and am now using vector forces despite them working way worse

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