Page 1 of 1

Small Problem need Pointers

PostPosted: Sat Jun 23, 2012 7:17 pm
by Turon
Now I actually think I have got nearly the right code, the user variable dir is set into dir = 1; for left and dir = 0 for right I used this for a fire ball shooting in a previous project,
but the challenge here is in Noseman the fire ball and noseman were separate actors this time it is the same actor.
now for instance a guy in the game presses a button activating a body posture in the same direction as the previous animation,
he lets go of the button and changes direction pressing the button again he finds it automaticly switched to the same direction.

Code: Select all
if(dir = 1;)
ChangeAnimation("Event Actor", "Bea Shoot left", NO_CHANGE;)
if
(dir = 0;)
ChangeAnimation('Event Actor",Bea Shoot Right", NO_CHANGE;)

Re: Small Problem need Pointers

PostPosted: Sat Jun 23, 2012 7:31 pm
by skydereign
The problem is your if statements. That isn't how you use them.
Code: Select all
if(var==1) // this checks if var is equal to 1
{
    // and if it is, it triggers this code
}

You want to use == instead of = because if you put a single equal, it will set the variable's value instead of check it.

Re: Small Problem need Pointers

PostPosted: Sun Jun 24, 2012 5:18 am
by Turon
Thank you Skdereingn! :D