|
| 15 Mar 2015 12:41 AM |
| i am wondering how to tell when a player is in the air from a jump or from falling? i need to know when the player is stnading and when the player is in the air. thanks! |
|
|
| Report Abuse |
|
|
Xymond
|
  |
| Joined: 27 Oct 2014 |
| Total Posts: 19 |
|
|
| 15 Mar 2015 12:46 AM |
For example.
game.Workspace.Player1.Humanoid.FreeFalling:connect(function(isJumping) --code goes in here. --isJumping is a true/false value to determine whether or not they're jumping. end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 15 Mar 2015 12:55 AM |
Or raycast 2.1 studs down from the torso and check if hit is nil or not. If hit is nil, the player is in the air
Offer on R$2,368 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
Xymond
|
  |
| Joined: 27 Oct 2014 |
| Total Posts: 19 |
|
|
| 15 Mar 2015 12:58 AM |
| On my previous script, you could use a different name for the boolean instead of 'IsJumping' because there is a seperate event for when the player is jumping. Change it to 'IsFalling' to make it easier to read. |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2015 02:49 AM |
@Sensei
That would require a loop, and no-one likes constant loops.
( ͡ಠ ͜ʖಠ) |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2015 03:05 AM |
Raycasting uses an extreme amount of cpu to calculate. Just putting that out there.
|
|
|
| Report Abuse |
|
|
|
| 15 Mar 2015 03:14 AM |
The way I do it is probably a little bit ugly, but I connect the .Jumping, .FallingDown, and .Freefall events to a functions that make a bool value named "Falling" true, then I connected every other HumanoidStateType to a function that makes "Falling" false. This is linked to my animation script though, so it doesn't look too sloppy.
( ͡ಠ ͜ʖಠ) |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2015 03:15 AM |
*to a function
I'm tired k
( ͡ಠ ͜ʖಠ) |
|
|
| Report Abuse |
|
|
|
| 15 Mar 2015 01:26 PM |
I would have a global function that raycasts down from the torso and returns if hit is true or not
Once I have that and need to check if the player is falling, id just do
if not _G.CharStanding() then
Offer on R$2,368 and send on 23,547 RAP |
|
|
| Report Abuse |
|
|
|
| 19 Apr 2016 05:19 PM |
| :O whoa that is way better thanks :D |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 19 Apr 2016 05:44 PM |
| actually the FreeFalling event wont be very efficient for this since it only triggers when the player is falling, not when they are rising |
|
|
| Report Abuse |
|
|
|
| 19 Apr 2016 06:10 PM |
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/GetState
|
|
|
| Report Abuse |
|
|
|
| 08 Jun 2017 03:07 PM |
| None of these are working for me |
|
|
| Report Abuse |
|
|