Page 1 of 1

Simple gravity script with Multiplier

PostPosted: Thu Oct 11, 2012 5:44 am
by Hblade
This is a simple script that I find rather useful! Especially when having larger enemies or other weighted objects.

How it works:
Basically you put the command setGrav(1) where 1 is the multiplier. You can make something light as a feather and make it fall super slow or heavy as can be and make it fall super fast. you also may be able to reverse gravity this way. Haven't tried it.

Heres the script:
Code: Select all
double gravity=.5;
void setGrav(double multiplier)
  {
      yvelocity+=gravity*multiplier;
  }


This needs to be put in Global Code somewhere.

Enjoy

Re: Simple gravity script with Multiplier

PostPosted: Thu Oct 11, 2012 5:47 am
by MrJolteon
Hblade wrote:you also may be able to reverse gravity this way. Haven't tried it.

It's possible, just set setGrav to a negative number.

Re: Simple gravity script with Multiplier

PostPosted: Fri Oct 12, 2012 4:41 am
by Hblade
yep. I dont use GE too much anymore, I don't really have any game ideas lately.