Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

TouchEnded Event triggers when character jumps?

Asked by 1 year ago

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

Log in to vote
0
Answered by 1 year ago
Edited 1 year ago
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

Ad

Answer this question