I currently want the player to be able to jump when a part that is welded to the player is hanging from another part. What would be the best way to go about detecting when the player is in this hanging state to make them jump?
Here is an image for better clarity:
The grey part is welded to the humanoid root part and is unanchored, when I try and jump nothing happens.
Here is the best method I’ve been able to come up with but it seems to also be going off even when the player isn’t in this state of hanging which can lead to unwanted double jumping. It’s a rare/difficult case but still possible.
--Inside of StarterCharacterScripts
game:GetService("UserInputService").JumpRequest:Connect(function()
if script.Parent.HumanoidRootPart.Velocity.Y < 0.5 and script.Parent.HumanoidRootPart.Velocity.Y > -0.5 then
print("jump")
script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)