hey devs, recently i encountered a bug that allows players to lift on grabbed object. and now i still cant fix it. i tried to change from body position to align position, but it still works unstable. i cant explain further, but heres is the code and a video so you might understand what is the problem and find a solution.
if not var.jumped then
bodypos.MaxForce = Vector3.new(0,3000,0)
bodyvel.MaxForce = Vector3.new(700,700,700)
bodygyro.MaxTorque = Vector3.new(20000,20000,20000)
if not game.ReplicatedFirst.System.Variables.CharacterDontMoves.Value then
bodyvel.Velocity = var.oldhum_movedir * hum.WalkSpeed + (ray.Instance.Velocity*Vector3.new(1,0,1))
else
bodyvel.Velocity = Vector3.zero + (ray.Instance.Velocity*Vector3.new(1,0,1))
end
if var.crouch then
bodypos.Position = ray.Position + Vector3.new(0,hum.HipHeight/2.3,0)
else
bodypos.Position = ray.Position + Vector3.new(0,hum.HipHeight,0) * 1.15
end
else
bodypos.MaxForce = Vector3.zero
bodyvel.MaxForce = Vector3.new(280,0,280)
end
AFAIK, the best solutions are to either force the player to drop the object if it is under them, or to stop the mover when that is the case. Or disable the collision between the object and the player.
i think the problem is in bodyposition, since it lifts the player and because the prop will be on ray and while bodyposition trying to get on target position, it will lift up the player endlessly.
would you not try to raycast downwards from the characters Head or HumanoidRootPart to see if their character is on top of the object they’re picking up and perhaps reposition that object so that it’s lifted up properly?
Set the collision group of the object to not collide with the player, this is by far the easiest solution. You can try a solution with physics but the juice really isn’t worth the squeeze in most cases
It is programmed to apply the exact velocity as floors, and it adds movedirection, so if you grab the object and move around, then your getting faster each second
i want it to dont accelerate and still move on a part. i think i should use CFrame:ToObjectSpace() here and apply its position (toobject + instance position) to BodyPosition, so itll be more stable ig
even without grabbing if your inside of some kind of box thing and start pushing its wall, itll still accelerate. ig its almost impossible to fix since default character controller and other games on other platforms has same iccue.