Whats wrong with this? (Variables)

Game Editor comments and discussion.

Whats wrong with this? (Variables)

Postby sonicfire » Fri Nov 03, 2006 10:14 am

I have an actor. In this i´ve defined a
Code: Select all
int enable_grav;
enable_grav = 1;

in the "Create Actor" event.

Then i have the "Draw Actor" event in which i use this variable:

Code: Select all
if (enable_grav)
{
   // do something
}


However this wont work! May i ask why?
How can i access variables that i´ve defined within actors?
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Postby makslane » Fri Nov 03, 2006 1:07 pm

To create global vars, you must put the declaration in the 'Global Code' editor, or use the 'Variables' button to create it.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby sonicfire » Fri Nov 03, 2006 2:41 pm

Thank you very much! :)
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron