VERSION 3 - OUT NOW Don’t Fall Version 3.0 Out Now!using a new ray system ooooo!
(Yes I do still ocassionally work on this)
Basically remade the entire script so that it’s much easier to read. Now it doesn’t unnecessarily store like a million position values. Instead we’re using a ray system which is just fires a ray down to see if the player is standing at a positon that it will not fall from.
I’m not sure if this is the best way to achieve the system but the script looks nice, it’s shorter and achieves the same effect with reduced bugs of the character being stuck in the air.
Really liking this, have found two glitches which would be nice if you could fix though the first of which is double jumping (jumping twice in a row). For some reason it starts to initiate the Don’t Fall script and I float back to the location of my first jump. The second glitch is if you jump just after floating back to your previous location you start to float midair (I can provide a video if you like but you should be able to reproduce this easily enough.)
Fixed issue where the module would teleport you to the latest CFrame instead of looping through to find the safest point to move the player to.
Fixed issue where jumping multiple times can activate Don’t Fall (Hopefully)
The module now also comes with an ‘Instant Teleport’ mode that can be toggled using the following: Antifall.InstantTeleport(true) or Antifall.InstantTeleport(false)
I can already see a lot of people using this in future. Not sure if you’ve already added it, but you could also add in settings the amount of time it will take to return player back to the safe spot, pretty sure you can easily do it with the TweenService.
What is Don’t Fall?
Don’t fall creates a log of the last 5 known positions of the player prior to falling and then allows you to either tween them back or teleport them back after they have been falling for X amount of seconds.
Using the new Don’t Fall is slightly different from the previous versions.
First, we require the module.
local DontFall = require(script:WaitForChild("DontFallV2"))
Then we create our tween information
local Info = TweenInfo.new(
0.8,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
And then create a new DontFall providing it with the information required
local DF = DontFall.new(
0.5, --Time before a fall is counted (seconds)
false, --Skip tween
Info) -- Tween info
And now we have to start it by doing
DF:Start()
--or we can stop it by doing DF:Stop()
It also shouldn’t have many bugs now but if you do find one let me know and it now uses rays to find if the player is on a part so infinite fall loops shouldn’t exist now.
Don’t Fall Version 3.0 Out Now!using a new ray system ooooo!
(Yes I do still ocassionally work on this)
Basically remade the entire script so that it’s much easier to read. Now it doesn’t unnecessarily store like a million position values. Instead we’re using a ray system in which just fires a ray down to see if the player is standing at a positon that it will not fall from.
I’m not sure if this is the best way to achieve the system but the script looks nice, it’s shorter and achieves the same effect with reduced bugs of the character being stuck in the air.