local bf=Instance.new'BodyForce'
bf.Parent=_G.hrp
_G.hrp.Velocity=_G.hrp.Velocity+Vector3.new(0,35,0)
_G.beat:Connect(function(dt)
local totalmass=0
for _,p in next,_G.char:GetDescendants()do
if p:IsA'BasePart'then
totalmass=totalmass+p:GetMass()
end
end
bf.Force=(proj[3].att.WorldPosition-_G.hrp.Position).Unit*totalmass*400+Vector3.new(0,totalmass*workspace.Gravity,0)
end)
So I was hoping to just get away with setting the initial velocity, but the problem is that if the target moves, then the character won’t follow since it’s glued to the ground:
Your anti-gravity component of the bf.Force is only enough to exactly counter gravity, so the force towards the attachment still has to counter friction of your character against the ground. To “lift” up, requires a net upward force, meaning it has to be more than exactly cancelling gravity.
On an unrelated note, it’s never too soon to break the habit of using _G for everyday game code. There is so much to learn, don’t burden yourself with things you need to unlearn!
isn’t friction calculated like: normal force*friction constant (static ig in this case)
since i’m counteracting gravity, the normal force is 0 so there is no friction
so then (proj[3].att.WorldPosition-_G.hrp.Position).Unit is the only force that should be acting on the hrp, and if the attachment is above the hrp, then there should be lift off
edit: also im pretty sure friction force is always perpendicular to the normal force
This is all correct, but in the first example it doesn’t look like the attachment is above the hrp, so I’d expect the pulling force to have a downward component. Also, if this is a normal Roblox avatar, the feet of the character are not technically collidable, so the “friction” is not normal physics system friction; perhaps it’s special-cased in a way that is sticking the character down? I agree that if the attachment is above the character, you’d expect movement.
I can’t tell what’s going on in the 3rd video, where you shoot upwards at the pink part. Why does it look like the character’s end of the rope goes way off screen to the right? The rope is glitching all over the place in the last video too, making me wonder if this is a bug with the attachment position, and not even a bodyforce issue. Have you inspected the values for the net force and attachment positions over the course of a failed grapple attempt?
The spazzing of the rope is due to a bug with the Roblox springconstraint visualization, the attachment is still in the proper place (evidenced by the location of the red plunger)