View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:33 am



Reply to topic  [ 7 posts ] 
 Gravity Variables In lua 
Author Message
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post 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.


Tue Jul 07, 2009 9:54 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: Gravity Variables In lua
Not that I remember. I think GlobalAccScalar is read-only right now.


Tue Jul 07, 2009 9:55 pm
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Gravity Variables In lua
Okay. So you can't, in effect, get rid of gravity yet without it being a scene?


Tue Jul 07, 2009 9:58 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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.


Tue Jul 07, 2009 10:02 pm
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Gravity Variables In lua
Oh ok, thanks :) What is the default variable for gravity?


Tue Jul 07, 2009 10:05 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Gravity Variables In lua
20. Older scenes had 19 ish.


Tue Jul 07, 2009 10:09 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Gravity Variables In lua
To get the scene's gravity, use SceneMan.GlobalAcc.


Tue Jul 07, 2009 10:09 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.086s | 14 Queries | GZIP : Off ]