Prevent player's character from falling

Hello. I recently made a system that brings the player at a position with a bodyposition and it set the orientation with a bodygyro. But I have a problem. When I delete them, the charactert falls for 1-2 seconds and while he’s falling, he can not move or do anything else. Help me please.
Video:

Code:

local bp = Instance.new("BodyPosition")
					local oldDirection = character.HumanoidRootPart.CFrame.lookVector
					bp.Name = "LightLightMirrorKick"
					bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
					bp.Position = calculatePos+Vector3.new(0,20,0)
					bp.Parent = character.HumanoidRootPart
					local bg = Instance.new('BodyGyro')
					bg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
					bg.CFrame = CFrame.new(calculatePos+Vector3.new(0,20,0), calculatePos)
repeat
						wait()
					until stopped == true
					
					bp:Destroy()
					bg:Destroy()
					--character.Humanoid.Jump = true
					wait(.1)
					character.HumanoidRootPart.CFrame = CFrame.new(calculatePos+Vector3.new(0,20,0), oldDirection)
3 Likes

We can’t tell you anything if you don’t post the script here.
Put triple backticks (```) before and after the pasted code so it formats properly.

2 Likes

I do know what is causing it tho, you can most likely just fix it by rotating the player back to upright in your code (since if a player is not facing upright, it acts as if it got tripped and will freefall until the body-gyro or whatever it is rotates it backup)

1 Like

Okay i edited the post and I added the code

It doesnt change anything, still falling

Disable the humanoid ragdoll state on the client.
use this:

https://developer.roblox.com/en-us/api-reference/function/Humanoid/SetStateEnabled

1 Like

Please take a look at this thread it might have the right solution:

Already checked, didnt work. I tested gettingup, landed, …

It didnt work, still the same issue.

What about this one? Has some useful stuff on the comment section:

So the value of calculatePos is above the big box?

Is the Player Humanoid.PlatformStand enabled? That would cause it to fall without being controlable. Maybe set it to Freefall.

Also, why are you doing this:
You are first raising the player with bp.Position = calculatePos+Vector3.new(0,20,0).
Then you Destroy bp after the repeat wait() loop.
Then you raise the Humanoid again with character.HumanoidRootPart.CFrame = CFrame.new(calculatePos+Vector3.new(0,20,0), oldDirection).
All