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.LocalPlayerlocal dummy = workspace:WaitForChild(“ClimbOverParts”)
local Debounce = truelocal 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
endkey.InputBegan:Connect(function(input)
local HumanoidRootPart = player.Character:FindFirstChild(“HumanoidRootPart”)
local distance = player:DistanceFromCharacter(pos.Position)
if input.KeyCode == Enum.KeyCode.Space thenif 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