-
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. -
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.
-
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.