Data Realms Fan Forums
http://45.55.195.193/

Gravity Variables In lua
http://45.55.195.193/viewtopic.php?f=73&t=15753
Page 1 of 1

Author:  Mind [ Tue Jul 07, 2009 9:54 pm ]
Post subject:  Gravity Variables In lua

Can you change the gravity of an area of course, by using lua? As in, are there variables you can change in lua that can change how much gravity an object has.

Author:  Duh102 [ Tue Jul 07, 2009 9:55 pm ]
Post subject:  Re: Gravity Variables In lua

Not that I remember. I think GlobalAccScalar is read-only right now.

Author:  Mind [ Tue Jul 07, 2009 9:58 pm ]
Post subject:  Re: Gravity Variables In lua

Okay. So you can't, in effect, get rid of gravity yet without it being a scene?

Author:  mail2345 [ Tue Jul 07, 2009 10:02 pm ]
Post subject:  Re: Gravity Variables In lua

To calculate the velocity to change gravity, use this code:
target.Vel.Y = target.Vel.Y + (gravity * TimerMan.DeltaTimeSecs)

gravity can be negative, like -20.

Author:  Mind [ Tue Jul 07, 2009 10:05 pm ]
Post subject:  Re: Gravity Variables In lua

Oh ok, thanks :) What is the default variable for gravity?

Author:  mail2345 [ Tue Jul 07, 2009 10:09 pm ]
Post subject:  Re: Gravity Variables In lua

20. Older scenes had 19 ish.

Author:  TheLastBanana [ Tue Jul 07, 2009 10:09 pm ]
Post subject:  Re: Gravity Variables In lua

To get the scene's gravity, use SceneMan.GlobalAcc.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/