How to get parts player is climbing on

how would I get the parts the player is climbing on??

is it possible to get the parts that the player is climbing on?
example: {truss}
or {part, part, part} since players can climb on to things that look like ladders

please explain more detail and please dont sound like a meme
your post should include more detail so others can help or people will ignore your topic

my caps lock is broken for a while idk why

1 Like

Hi, you can check the humanoid’s StateType and then use a raycast to get the part directly in front of them. I’ve attached code to check the StateType

Place this script in StarterCharacterScripts

local hum = script.Parent:WaitForChild('Humanoid')

hum.StateChanged:Connect(function()
	print(hum:GetState())
end)

Read more about this event here

1 Like

Hey there, let me give you some of my wisdom.

You can use HumanoidStateType like Barkus just demonstrated, Instead of printing the StateType we need to actually check if the player is climbing something, here is the code:

local hum = script.Parent:WaitForChild('Humanoid')

hum.StateChanged:Connect(function()
     if hum:GetState() == Enum.HumanoidStateType.Climbing then
-- player is climbing put code in here (raycast)
end
end)
1 Like