How to fix character lifting on props

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

1 Like

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?

Classic physical grabbing system issue.

There’s a few ways to go about solving this:

  1. Disable the prop’s collision with the player
  2. Disable the constraint if the player is standing on it
  3. Enforce a distance limit from the character, preventing the prop from getting too close to the player.
  4. Newton’s 3rd law: Apply an equal and opposite force downwards.
1 Like

i just did the 4th method, but now how do i fix the speeding up thing now?

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

i would do that, but the player will noclip thru vehicles while grabbing on them

Can you clarify what you mean by speeding up?

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

bodyvel.Velocity = var.oldhum_movedir * hum.WalkSpeed + (ray.Instance.Velocity*Vector3.new(1,0,1))

Why are you adding the move velocity?

i made it so character will be able to walk on moving parts

So if I’m understanding you correctly, when the player stands on the prop they’re grabbing, they keep accelerating?

Can you clarify what is the desired behavior?

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

You might want to go with disabling the constraint when they’re standing on the part then.

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.