Struggling to Identify Unpause Button in Scene Behavior


Luyren

  • *
  • Posts: 2732
Make your code a behavior.
Make a non-hidden actor attribute, and reference that in your code.
When you attach the behavior to your scene, select the non-hidden actor attribute, and select the actor button you placed in the scene designer.

Or, better yet, make this an actor behavior and attach it to your button actor. That way you can reference "self" without attributes.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

sajoshua

  • *
  • Posts: 5
Hi Luyren,

Thank you for helping! My first attempt was an actor behavior referencing "self". It paused the game but did not unpause it.

So I tried doing what you said: I made a non-hidden actor attribute "PausePlayAttribute", referenced it inside a *scene* behavior, and selected the actor button.

It worked for pausing!...but not for unpausing. I attached a screenshot.

Please advise further. I know how to pause with a keyboard stroke - I copied the Stencylpedia entry.

But I need to pause on an iPad with no keyboard.

Surely this must be possible!


Luyren

  • *
  • Posts: 2732
You must set your actor to "cannot be paused" in its settings. My recommendation is to revert back to the actor method, it's less cumbersome.

Your code also needs to replace the second "if" with an "otherwise", otherwise both IFs will work and your game will pause and unpause in the same frame.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter