Ragdoll problem when player is being teleported

Hello!
Basically, i am trying to make a wall climbing system.
When player presses “SpaceBar”, Player is being teleported to part.

When Action happens, player get’s teleported but is being stuck.

I tried looking at dev forum but that did not really help, i just tried :SetPrimaryPartCFrame() and that’s still not working

Script:

local Camera = workspace.CurrentCamera

local players = game:GetService(“Players”)
local player = players.LocalPlayer

local dummy = workspace:WaitForChild(“ClimbOverParts”)
local Debounce = true

local Humanoid = player.Character:FindFirstChild(“Humanoid”)
local Animator = Humanoid:WaitForChild(“Animator”)
local Animation = script.Animation
local AnimationTrack = Animator:LoadAnimation(Animation)

for _, part in pairs(workspace.ClimbOverParts:GetChildren()) do
local pos = part
local key = game:GetService(“UserInputService”)

function lookAt()
if player.Character.PrimaryPart then
local chrPos = player.Character.PrimaryPart.Position
local tPos = pos.Position
local newCF = CFrame.new(chrPos,tPos)
player.Character:SetPrimaryPartCFrame(newCF)
end
end

key.InputBegan:Connect(function(input)
local HumanoidRootPart = player.Character:FindFirstChild(“HumanoidRootPart”)
local distance = player:DistanceFromCharacter(pos.Position)
if input.KeyCode == Enum.KeyCode.Space then

  	if distance <= 5 then
	if Debounce == true then
		--Debounce = false
	
	print("CanJump")
	--HumanoidRootPart.CFrame = pos.TelPart.CFrame
	player.Character:SetPrimaryPartCFrame(pos.TelPart.CFrame)
	--player.Character.FirstPersonCamera.Enabled = false
	part.CanCollide = false
	lookAt()
	--script.Jump.Enabled = true
		--wait(0.1)
		--HumanoidRootPart.Anchored = true
		--wait(1)
		--for i,v in pairs(player.Character.Humanoid:GetPlayingAnimationTracks()) do
		--	v:Stop()
		--end
		--wait(1)
		--AnimationTrack:Play(0.100000001,1,1)
		--AnimationTrack:AdjustWeight(1)
	--repeat wait()
	--	Camera.CameraType = Enum.CameraType.Scriptable
	--until Camera.CameraType == Enum.CameraType.Scriptable
	--Camera.CFrame = pos.CamPart.CFrame
	wait(1)
	--HumanoidRootPart.CFrame = pos.EndPart.CFrame
end
end

end






end)
end

1 Like

It looks like you teleported into the part. Try making it so you teleport a little bit in front of it.

1 Like

Thank you so much, this helped!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.