Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

TouchEnded Event triggers when character jumps?

Hello!

I want to stop the touch ended event from triggering when user jumps.

is there a method I can use to stop/cancel touch ended event from triggering when user jumps, a couple methods I have tried. ---if Humanoid.Jump == true then return ---game:GetService("UserInputService").InputBegan.... if input.KeyCode == Space then return..

Possible methods that I have not tried: ---Comparing vector ---Possibly checking if jump animation is playing then return??

My game requires the player to jump, thus I will not be disabling it.

Thank you for reading!

(P.S) Please do not recommend using ZonePlus, and any remarks/suggestions/comments regarding to its usage will be ignored.

1 answer

if not game.Players.LocalPlayer.Character.Humanoid:GetState() == Enum.HumanoidStateType.Jumping then
	-- Player is not jumping
end

you can also check if the humanoid is freefalling using this as I assume you dont want the event to trigger from that as well

you can also switch the pathing to whatever path the humanoid is

This discussion is preserved as it was. New answers, comments, and votes are closed.