Jump to content


Photo

Check path = active


  • Please log in to reply
3 replies to this topic

#1 vinter93

vinter93

    GMC Member

  • New Member
  • 2 posts
  • Version:GM:Studio

Posted 28 March 2016 - 03:18 PM

Hello.
Im new at making games and there is still some stuff i need to learn..
Is there any way to check if a path is runing ?
For example
Path0 is set to object0 and check if that path is runing (the path is triggered by key up) .
Something like
If Path0 = runing
{
Do stuff
}
  • 0

#2 anomalous

anomalous

    GMC Member

  • GMC Member
  • 295 posts
  • Version:GM:Studio

Posted 28 March 2016 - 05:16 PM

Well, paths don't really run.
you create/edit them, and you can assign an instance to "follow a path" at a certain speed.

Do you mean you want to know if an instance is following a path?  I would personally do that by setting a variable "on_path" when I set something to follow a path, and "off_path", when they reach the end. 
But the function path_index appears to give you the index of the path an instance is following, or a -1 if it's not following.

 

(path = the path you want to check is being following)

So in your case:

if path_index == path

{

}


  • 0

#3 Bojack29

Bojack29

    GMC Member

  • GMC Member
  • 1649 posts
  • Version:GM:Studio

Posted 28 March 2016 - 06:19 PM

You can check if your character is currently using a path
if (path_index > -4){
     //On a path
}else{
     //Not on a path
}

  • 0

#4 vinter93

vinter93

    GMC Member

  • New Member
  • 2 posts
  • Version:GM:Studio

Posted 28 March 2016 - 07:48 PM

I already figured out a way to make what i wanted.
But thank you so much anyway for the info, its always good to learn more!
  • 0