Enable/Disable behaviors on iOS


  • Posts: 351
I'm still having problems with these, and wondered when it's going to be fixed?

From my tests Enable/Disable behaviors on iOS just don't work at all. I really need them to work so I can save memory and calculations.



  • *
  • Posts: 6108
Maybe it will be fixed in 3.0.

As a workaround, you can add a boolean to every behavior you want to be able to disable/enable. Then check "if <Enabled>" at the beginning of each event in the behaviors.
And use messaging blocks to enable/disable the behavior:
"for <actor>/scene, set _Enabled to <true>/<false> for behavior _"


  • Posts: 351
Thanks Captain, that is what I'm already currently doing.

I'm having problems with my game jolting on the iPhone 4 and iPod touch. Been working on this jolting for over a month and I just cant solve it. I'm trying to get the number of Always calculations as low as possible. I've managed to get it down to about 8, which are in booles, so some aren't even being calculated each frame.

Because my game is a constant moving game, (you have to aviod obstacles), it's easy to notice the jolts.

I'm starting to think its a problem with stencyl, as I read another post where someone said that they are noticing actors jolting even if the FPS is high. They said the cause was due to the game having a large number of actors, even if not many were being used.

My game is getting a steady 59-60 FPS all the time on all 3 iOS devices and the FPS never drops, yet it still jolts. I've tried disabling every behavior expect the 3 that are neccessary to make the game run, and I still get it. If I look at my code, theres barely any Always code, nothing that the iPhone shouldn't be able to cope with.

Is anyone from the stencyl team able to send me one of there test iOS device details, and I can build them a version?

I've been reluctant to share my code, but I'll have to if it will solve the problem.


« Last Edit: June 22, 2012, 05:49:36 am by toml2003 »

Hi Tom, jumped over from the thead where I heard about this.  ;D

I'm probably missing something but are you referring to the buttons that let you Activate or Deactivate behaviours, and the little check-boxes next to each event within a behaviour?

Those work - I've been doing loads of testing this week to get my game speeded up.

Also I'm not sure if you've seen my post about speeding iOS. I'm not an expert or anything but there might be something in there that could help?


And if you want to email me your code, I'd be happy to look at it.

EDIT: How are you moving things within the game? There's a number of ways to set motion and some will work better in a game than others.


  • Posts: 250
I think he meants enabling/disabling behaviours in the runtime, via code blocks.


  • Posts: 351
Thanks for replying.

No, what I mean is the blocks that come under Behavior>State>Enable/Disable in the code designs.

Yes, I did read your post last week, it was very helpful, and I managed to get rid of all my game attributes being called.

Yeah, I'll email you the main behaviors, what your email address?

Where are you, US or UK?

I use a slide tween, because they look the best with a doubt. I have used x-speed and push, but they all still jolt. Also, I'm only setting the tween once, so its not like its always trying to reset. As I say, the code works fine, because the game is 100% smooth on my 4S, but theres something that the 4 and ipod touch actually handle.

I'm in the UK.  :D

If you can email to tomarmstrong1 AT gmail.com I'll see if I can get it running here. I've got a 3rd gen ipod that should reproduce the problems.

I think he meants enabling/disabling behaviours in the runtime, via code blocks.

Ah, right sorry. I've not used those yet so can't comment. :-)


  • Posts: 351
Cool, I'm in the UK as well. Norwich... :)

Yeah, I'll send you an email tomorrow afternoon, as I'm at work right now and tomorrow morning.

I'll ask for you're iPod details in the email, and I'll add them to my provision profile.

Thanks alot.

Ah cool. I'm up in Sunderland. :-)

I'll wait for your email. Might not be able to spot anything you haven't but I'll take a peak.


  • Posts: 351
Ha, my ex goes to Uni there.

Okay, well if you get a build on the iPod, you'll see what the problem is.