Pause Character on Path Getting Stuck

Hello all!

We are trying to get an object to pause on a path and then continue on with the path and the code after it.

This example shows the raccoon moving on the path.

Hit pause he pauses and then resumes walking on the path.

The issue is if you hit pause the code will never hit line 12 and dance.

When you play the code without hitting pause everything runs fine.

Why is the block on line 11 getting stuck when we hit the pause button?


Hi @SagesOfRPG,
Think of lines 9 and 11 as two different paths. when line 11 is activated, the raccoon goes on the path, but then code 9 makes the raccoon stop what it’s doing, and goes on the path as in line 9. therefore, since line 11 is terminated, line twelve will be gone as well. Try putting the dance code after line 9.


PS. If you don’t believe me, press play and DO NOT pause. The raccoon will dance after the path is completed.


Here is a fixed version:

1 Like

Hi @SagesOfRPG,

I’d actually consider this a bug - I don’t think stopping the transition should prevent the further running of the program. @Stefan , what are your thoughts?

Geoff @ TechLeap

There is no way to stop or pause the transition then continue. The program sees this as two separate actions. All you need to do to fix this is to add the end component of dancing in the “When Clicked” action and it will fix the issue.

Once you click the pause button it sets the raccoon on a new transition. I started doing an If/else conditional for the pause before I realized that this was a much easier fix.

@btcostello05, your solution is the same as @Bladebob20000’s (which is great!), however I believe that the issue remains - the stop transition prevents any further code in the main sequence from running. It doesn’t just stop the transition, it stops the whole process.

@Stefan, keen to hear your thoughts on this!

Geoff @ TechLeap

I saw that solution after I posted it, but yes it is the logical way for block coding to work. I can’t think of a scenario where you can pause a program, run an alternate program, then resume the program as if nothing happened using blocks. I know it is possible, but I have not seen it with blocks anywhere.
It might be a pretty fantastic feature request, but not necessarily a bug.

There is a way to do it, I think, though I stopped working on it because I didn’t see it being what was actually requested. Instead of having the racoon move along the path in 10 seconds, the racoon would move along the path with it’s speed decreasing as it approached the endpoint of the pathline.

Thanks Brian,

I guess what I find difficult to understand is that I can run any other block in that event, including a new transition, and the program will run that event as a separate process and the main sequence continues; but if you add a stop transition, the main sequence stops.

We can get around this by putting the move on path code into a function, using run separately on the main sequence and adding an isFinished state check to the remaining sequence:

Here’s my version, which is probably overkill, but is what I’m happier with:

Yes, we could also add a timer and reduce the distance and time so that it’s a more accurate pause, but I’ll leave that challenge for someone else :blush:

Geoff @ TechLeap

This is a great example. It is more or less what I started before I realized the extremely simple solution. I wouldn’t call it over kill as I was trying to create a speed reduction to slow to a stop :rofl:

1 Like

Hello techleapnz, hello SagesOfRPG,

it is really very interesting and tricky case, described by SagesOfRPG! I’m really puzzled :slight_smile: We will discuss it with @Stefan and other developers and give you feedback.


1 Like