Why dose teleporting my HumanoidRootPart brake my tools?

So in my game to go into a house, you teleport to it and I am using a way of doing HumanoidRootPart.Position but it brakes one of my main tools the tool puts a clone in a position it works fine until I use the teleporter and I want to know how can I make it so when I do teleport my tool doesn’t break?

4 Likes

Before teleporting clone the tool into nil, then when the teleport is finished delete the original tool and set the cloned tool’s parent to the player backpack. Also, use CFrame, not Position.

2 Likes

can you tell me how i can use the Cframe? if you show me that would be great

1 Like

This is not necessary unless it is what OP was already using before the problem and works fine. All you need to do is

HumanoidRootPart.CFrame = CFrame.new(position)

or you can just do:

 --//(example)
    local cf = TeleportPart.CFrame
    HumanoidRootPart.CFrame = cf

CFrame holds an orientation as well as the position, which will be useful if you want to make them teleport facing a certain direction.

2 Likes

image

i try your code and it shows this.
is there a way you can help me?
i did makea humanoid variable the same name as yours and it gets the humanoid root part

1 Like

As said by error message, you used an Instance instead of CFrame.

For example:

:x:
HumanoidRootPart.CFrame = Part

:heavy_check_mark:
HumanoidRootPart.CFrame = Part.CFrame

You do not have to use a part, but with most basic teleportation systems its the easiest method to go with and works fine.

Basically you cannot set the position of the humanoidrootpart as it is likely to break stuff in your character. With any parts, if you wont to change their position you will need to do
Part.CFrame = CFrame.new(position)

2 Likes

Thanks it works and the tools works but when it teleports me it flings me it dose not just place me, what can i do to fix that?

1 Like

If they are flinging because of the part, you can do

local HEIGHT = 5 -- in studs
HumanoidRootPart.CFrame = Part.CFrame + Vector3.new(0,HEIGHT,0)

I suggest though instead of doing the above to just disable the CanCollide property of the telport part so the player doesn’t collide with it and goes through it.

1 Like

CanCollide is off and sorry by flinging i meant it teleports me so fast that my player goes into the state where its like frozen for a moment before it can move like when you sit but there is no seat,and your code did not work i think cuz i gave you the wrong info

it dose a platform stand

Try putting this after when you teleport them, if not I’m not sure.

coroutine.resume(coroutine.create(function()
	for i = 1,3 do
		HumanoidRootPart.Parent:FindFirstChildOfClass("Humanoid"):ChangeState(Enum.HumanoidStateType.Freefall)
		game:GetService("RunService").Heartbeat:Wait()
	end
end))
1 Like

sorry i just found out it dose a platform stand for a moment is that something this code will fix?

should i try this code for the platform stand?

if you are teleporting to a part, make sure that part is not tilted.
try rotating the target part like this:
image

1 Like

no it not tilted it just dose a quik platform stand before the player being able to move, i wana know how can i fix that?

maybe try this after teleporting?

Humanoid.PlatformStand = false -- humanoid should be that player's Humanoid.
1 Like

WAIT its fixed i just had to make the part bigger sorry for the inconvince

I fixed it by not using HumanoidRootPart.Position but by using its Cframe, thanks for the help boys.

2 Likes