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)
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)
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