• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

See Instances in the Debugger?

So

I've managed to work out getting code up during the debugger to watch it, but how to do I actually watch the code and scripts a specific instance is running for objects and scripts that are being used multiple times?
 

TsukaYuriko

☄️
Forum Staff
Moderator
Before running the game, put a breakpoint in your code by clicking a bit to the left of the line number. The game will now stop at this breakpoint once that code is reached.

You can also manually pause execution by clicking the pause button in the debugger.
 
Before running the game, put a breakpoint in your code by clicking a bit to the left of the line number. The game will now stop at this breakpoint once that code is reached.

You can also manually pause execution by clicking the pause button in the debugger.
That doesn't help me much when I have something like a gravity function that's being engaged by multiple instances and I need to look at specifically how one instance of one object is running it
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
That doesn't help me much when I have something like a gravity function that's being engaged by multiple instances and I need to look at specifically how one instance of one object is running it
Yes it does. You add the breakpoint just before the function call then run the debugger. Each time the game pauses because of the breakpoint you can check which instance is using it and either continue (press play and wait till the breakpoint is reached again) or step through the code... You can also check individual instance variable values at any time using the Debugger Instances window at the bottom, and you can add watches to the variables window so you can keep an eye on a specific variable in a specific instance.
 
Yes it does. You add the breakpoint just before the function call then run the debugger. Each time the game pauses because of the breakpoint you can check which instance is using it and either continue (press play and wait till the breakpoint is reached again) or step through the code... You can also check individual instance variable values at any time using the Debugger Instances window at the bottom, and you can add watches to the variables window so you can keep an eye on a specific variable in a specific instance.
How do I check which instance triggered it?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
In the output window there will be a section for "Instance", which is the instance currently in scope (not to be confused with "Instances" which lists all instances in the game). Note that you should also be able to select an instance directly in the game window by clicking on it, and this should show up under a "Selected Instance" window. See here: https://manual.yoyogames.com/#t=IDE_Tools/The_Debugger/Watches.htm
 
Top