generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Check if object in air

Previous Thread :: Next Thread 
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 03:03 PM
no I can't check distance from ground because the ground is uneven.

Currently I'm checking if the Y velocity is higher than a certain point or lower than a certain point (falling)

But this is glitchy and sometimes when it isn't even going up or falling inAir is still true

inAir = car.Velocity.Y > 10 and true or false or car.Velocity.Y < -1 and true or false



My baguetteometer is going off the charts
Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
14 Jul 2016 03:15 PM
--Vector3.new(0,height,0)
-- The middle there is the height of an object,that probably may help you(i write "height" --there so you couldn't height so couldn't get confused...


-- that may help you idk ,if not just ignore this :P
Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
14 Jul 2016 03:16 PM
"so you couldn't get confused"* xD i cant type today
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:07 PM
did you even read the title jfc


My baguetteometer is going off the charts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:09 PM
part:IsGrounded

should work as long as your ground is anchored


Add 13,000 posts
Report Abuse
modulum is not online. modulum
Joined: 11 Jul 2016
Total Posts: 242
14 Jul 2016 04:10 PM
It would probably be better to check the position rather than velocity. Is your map just a flat map, or does it have different heights?
Report Abuse
modulum is not online. modulum
Joined: 11 Jul 2016
Total Posts: 242
14 Jul 2016 04:10 PM
Nevermind what I just said, Lord_Narwal's is much better.
I had no idea that was even a function.
Report Abuse
Ryuzoji is not online. Ryuzoji
Joined: 21 Dec 2015
Total Posts: 937
14 Jul 2016 04:11 PM
Wtf there is IsGrounded?
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:11 PM
@Ryu

ikr

i found it in the API for baseparts

they add so much stuff under the radar lol


Add 13,000 posts
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:19 PM
Doesn't work.


My baguetteometer is going off the charts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:20 PM
did you try

if part:IsGrounded() == false then
end


Add 13,000 posts
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:20 PM
Doesn't the part have to be connected, as in with surface inputs (studs into inlet etc) to be grounded?


My baguetteometer is going off the charts
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:21 PM
@Lord

printed car:IsGrounded() in a renderstepped function and it printed false.


My baguetteometer is going off the charts
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
14 Jul 2016 04:21 PM
You can raycast straight down from the object.
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:22 PM
@darth

isn't that just checking the distance, which I said I can't do as the ground is uneven.


My baguetteometer is going off the charts
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
14 Jul 2016 04:23 PM
Raycast down from each wheel then.
Report Abuse
GraphicsSettings is not online. GraphicsSettings
Joined: 12 Sep 2013
Total Posts: 2883
14 Jul 2016 04:23 PM
"no I can't check distance from ground because the ground is uneven."

Does this mean shooting a ray and comparing the ray end and start?
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:23 PM
"Raycast down from each wheel then."

it's a single mesh.


My baguetteometer is going off the charts
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
14 Jul 2016 04:24 PM
@badfitz, uh yeah you can. Raycast to the point below the car and see if the part is the a groundpart


Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
14 Jul 2016 04:24 PM
So get the offset from the middle of the origin part for each of the wheels and raycast. Or just accept that you're not going to get 100% accuracy from a mesh on uneven terrain.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:25 PM
try this

for each wheel, use GetTouchingParts

if any of the parts are ground then it's not in the air


Add 13,000 posts
Report Abuse
0Dan is not online. 0Dan
Joined: 22 Oct 2009
Total Posts: 2552
14 Jul 2016 04:25 PM
Could make invisible parts where the wheels are and weld it to the single mesh, then ray cast down from that


𝐃𝐚𝐧𝐢𝐞𝐥
Report Abuse
badfitz67 is not online. badfitz67
Joined: 03 Jun 2010
Total Posts: 13165
14 Jul 2016 04:26 PM
@lord

http://wiki.roblox.com/index.php?title=API:Class/BasePart/GetTouchingParts

it has to be inside the part for it to be touching.


My baguetteometer is going off the charts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:27 PM
ok try this

rage quit because fdfbdfg


Add 13,000 posts
Report Abuse
darthpyro is not online. darthpyro
Joined: 18 Aug 2009
Total Posts: 3569
14 Jul 2016 04:28 PM
Put a thin, invisible, non-collidable part below the car and use GetTouchingParts.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image