Hey, developers, I have a question how can I detect when a user is falling, without the Freefall state? this has been a question I had for a bunch of time and never found an answer, please respond if you know how to.
.
Hey, developers, I have a question how can I detect when a user is falling, without the Freefall state? this has been a question I had for a bunch of time and never found an answer, please respond if you know how to.
.
the only alternative one I know is for the Humanoid properties, FloorMaterial, detects on what material you’re stepping, including Air if you are falling
This won’t work for my situation… l
This post seems to have some solution that could be what youre looking for?
Fairly simple, here are some ways to do it:
Without the freefall state
local Falling=false
humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
Falling=humanoid.FloorMaterial==Enum.Material.Air
end
Without humanoid behavior at all (client sided)
local FallingTime=0
local RunService=game:GetService("RunService")
local part=Character.Torso
RunService.RenderStepped:Connect(function()
Falling=part.AssemblyLinearVelocity.Y<0
end)
local FallingTime=0
local RunService=game:GetService("RunService")
local part=Character.Torso
RunService.RenderStepped:Connect(function()
Falling=part.AssemblyLinearVelocity.Y<0
end)
Is there anyway to do this on server?
Not advised if you’re going for a character controller due to delay.
but if you want to do it on server
change RenderStepped to Hearbeat
Edit:
you can delete the “FallingTime” accidently wrote it while thinking on an answer.
Thank you, Ill test if it works!
Could you maybe explain what your situation is then? What’s your use case and why does the Freefalling state not work for it? If you share your use case for checking if the character is falling it might be easier to offer recommendations here or address your issue with using Freefalling.
It can be spoofed by exploiters
What are you trying to accomplish?
Detection of a user whenever he falls, not using FloorMaterial or States
I dont understand why you don’t want to use the humanoid state then. Checking in other ways is inefficient and may cause a lot of issues in the long run if you don’t know how your script works.
Its for an anti exploit, and using states exploiters could spoof it.
So you are trying to make an anti fly script?
I made an anti fly script, its just falling gives you false positives
Wait, I just tested once of the comments and it works ? thought I’ll keep it temporary until i find a better one
(Now setting a solution to that comment)
I have an Idea for that. Try using an invisible 0.01 stud block that gets spawned when the player starts falling while updating it’s Z and X coordinates. If they both dont fall in a reasonable time frame from each other. (aka block reaches the ground and fires an event) The player gets moderated.
Edit: This could also help with checks while having custom behaviour. For example double jumping could impose the same force on the block as the double jumping player. Preventing false positives.
This check works but may cause false positives when custom jumping behaviour is added.
Maybe this would work? (I mean it all comes down to what your game needs.)
Hey, do you by chance know how to detect when a user is climbing (without the state) @WhiteOut_RBLX