Character falls when tweeing humanoidrootpart

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like help on fixing this issue

  2. What is the issue? Include screenshots / videos if possible!
    When tweening the humanoidrootpart the character just falls

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried to make a weld (resulted in character falling but not going through the ground, same with weld constraints, motor6ds do the same but the character will fall through the ground.)

Script:

			HRP.Anchored = false
			local lti = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
			TS:Create(HRP, lti, {Position = Vector3.new(HRP.Position.X,GrabPart.Position.Y + (GrabPart.Size.Y / 2) -char.Head.Size.Y -1,HRP.Position.Z)}):Play()
			--TS:Create(char.Torso, lti, {Position = Vector3.new(HRP.Position.X,GrabPart.Position.Y + (GrabPart.Size.Y / 2) -char.Head.Size.Y -1,HRP.Position.Z), Orientation = HRP.Orientation}):Play()
			--HRP.Position = Vector3.new(HRP.Position.X,GrabPart.Position.Y + (GrabPart.Size.Y / 2) -char.Head.Size.Y -1,HRP.Position.Z)
			delay(0.5, function()
				HRP.Anchored = true
			end)

Anchoring the HumanoidRootPart while it tweens would solve this issue, though?

Also I recommend using CFrame rather than Position.

I qm currently laying down so i cannot test this now. I do believe i tried anchoring the humanoidrootpart but i cant remember what it did so i probably didnt, by the way would the equation be different in CFrame? Or would you just replace all the “Positions” with “CFrame”

Shouldn’t be different, no. But you’d change Position to CFrame and Vector3 to CFrame obviously.

And I think I misinterpreted earlier, but yes change stuff like HRP.Postion.X to HRP.CFrame.X

If that still doesn’t work I can write you a quick tween implementation for this specific use case.

Make new “BodyVelocity” in “HumanoidRootPart” and set the velocity to “Vector3.new()”. Here is a script :

local velocity_controller = Instance.new("BodyVelocity", game:GetService("Players").LocalPlayer.Character.HumanoidRootPart)
velocity_controller.MaxForce = Vector3.new(1,1,1) * 9e9
velocity_controller.P = 3000
velocity_controller.Velocity = Vector3.new() -- 0, 0, 0

I will switch to cframe and i will also try it out

If it doesnt workiwill try this

HRP.Position.X is the same as HRP.CFrame.X.
https://developer.roblox.com/en-us/api-reference/datatype/CFrame
The ‘X’, ‘Y’ and ‘Z’ properties of a CFrame value simply describe its ‘X’, ‘Y’ and ‘Z’ axis positions respectively.

1 Like

Try anchoring all of the character’s descendants.

for _, Descendant in ipairs(Character:GetDescendants()) do
	if Descendant:IsA("BasePart") then Descendant.Anchored = true end
end

i do not think this would work because the body wouldn’t follow the humanoidrootpart.

I didn’t see you were trying to tween the character, I thought you were just trying to freeze it.

this works for my main goal (to stop the character from falling) but it will offset the character when moving the humanoidrootpart (it only moves the humanoidrootpart)

That’s weird because that’s by far the most classic way to move HumanoidRootParts.

Anchor RootPart → CFrame to new position(s) → Unanchor RootPart

I can send a video here in a second.

1 Like

Alright well it wont let me send one.

Here’s a screenshot instead

Code:

			HRP.Anchored = true
			local lti = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
			TS:Create(HRP, lti, {Position = Vector3.new(HRP.Position.X,GrabPart.Position.Y + (GrabPart.Size.Y / 2) -char.Head.Size.Y -1,HRP.Position.Z)}):Play()
			--TS:Create(char.Torso, lti, {Position = Vector3.new(HRP.Position.X,GrabPart.Position.Y + (GrabPart.Size.Y / 2) -char.Head.Size.Y -1,HRP.Position.Z), Orientation = HRP.Orientation}):Play()
			--HRP.Position = Vector3.new(HRP.Position.X,GrabPart.Position.Y + (GrabPart.Size.Y / 2) -char.Head.Size.Y -1,HRP.Position.Z)

Using that commented out tween it only offsets limbs


With the torso tween on…

You can use a BodyPosition parented to the humanoid root part and set its position property. This way you wouldn’t have to anchor it.

It will use forces to keep the part in that position but it won’t care about rotation. In which case you also use a BodyGyro and set its CFrame property, when setting the CFrame property don’t worry about the position because that will be ignored.

While in this state you may want to set the Humanoid’s AutoRotate property to false, so if the player uses shift lock or goes into first person their character won’t follow along.

They’re deprecated though so I’m not sure if you should use them, I mean… I do and it seems to work as intended.

1 Like

Will this solution tween? Cause I want it to tween.

Unfortunately not exactly how you want it, but it won’t exactly teleport your character. You can change the strength of the forces to make some sort of transition I guess.

Thanks! It actually does replicate the effect of a tween pretty well, this is pretty close to what I wanted!

1 Like