GML Visual Variable Error?

T

Treecase86

Guest
Hello, for my game I have some code for if the player's image_index =1,2 or 3, they will have different skills, to better explain read this, and this. Anyway, I'm trying to have it so that if the player's image_index=3, they are faster, and can jump higher. so, I started off with this code to make the player jump higher.

In event one,
Code:
if globalvar SumiJump = true, gravity=1;
And in another event,
Code:
if image_index = 3 SumiJump = true
But Gamemaker said there's an 'unexpected symbol in expression at pos 5' in event one.

Please help solve this.
 

Carolusclen

Member
change this
Code:
if globalvar SumiJump = true, gravity=1;
to

Code:
if (global.SumiJump = true)
{
    gravity=1;
}
where you register the variable in the creation event, change that to global.SumiJump = false
 

RangerX

Member
I don't thing you can declare a variable in a condition that way.
Your condition should be:

if(global.SumiJump==true)
{
gravity=1;
}


EDIT: Ninja'd
 
Top