• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Question regarding the event_preform function..

A

Ayziak

Guest
I have a collision event, which I need to use to set off a keyboard event in another object. Here's the code I used:
Code:
//Collision Event
event_perform_object(obj_char, ev_keyboard, ord("A"));
My problem is that since a collision event triggers every step, only the first line of the A-key event in obj_char is triggered, an analogy would be, like setting a timeline in a step event. Is there a simple way to make the whole event play through, only looping at the end?
 

RangerX

Member
So you want to trigger it once?
If its that so, you need a variable tracking that this event is performed or not.

if(EvenStarted==false)
then
{
event_perform_object(obj_char, ev_keyboard, ord("A"));
EvenStarted=true;
}

Then at some point you reset back the variable.
 
A

Ayziak

Guest
So you want to trigger it once?
If its that so, you need a variable tracking that this event is performed or not.

if(EvenStarted==false)
then
{
event_perform_object(obj_char, ev_keyboard, ord("A"));
EvenStarted=true;
}

Then at some point you reset back the variable.
Thanks!!
 
Top