Pause messing up actors under physics

darrigaz

  • Posts: 124
I'm trying to add a momentary pause when a projectile hits an enemy in my game. I've done the code but for some reason when I do the unpause actors that are moving under physics seem to get stuck and  need a later unpause to be start moving again.

Can anyone tell me what's going on or maybe suggest a better way of getting the same effect?

darrigaz

  • Posts: 124
Ah! This is driving me mad. I can fix the stuck actors by forcing an unpause (using the resume button on my pause menu) but if i do it in the behaviour more than 0.5 of a second after the initial pause it doesn't work...

darrigaz

  • Posts: 124
It seems like basically the first time I pause and unpause some stuff doesn't unpause properly. If I then pause and unpause again that stuff frees up and goes about its business.

merrak

  • *
  • Posts: 2646
What are those behaviors attached to?


darrigaz

  • Posts: 124
Hmmm. So I think I got this to go away by not calling a screenshake and a pause at the same time. Is there anyway a screenshake and a pause could interfere with each other?

merrak

  • *
  • Posts: 2646
I wonder if pausing the game is even the best way to get this effect. What happens if the player attempts to pause the game while the effect is running? Will that throw the game off? As a player, I might even find the effect annoying... if it throws off my timing or there are a lot of enemies pausing the game. It does look cool, though.

I wouldn't expect screenshake and pause to interfere, but I don't use screenshakes very much. The only thing I can think of to do is put print statements inside every event and also in every if statement, and get a snapshot of the execution order when the game pauses and unpauses.

colburt187

  • *
  • Posts: 2416
Maybe instead of pause, changing the step speed using this code block, I'm using it for slow motion.

darrigaz

  • Posts: 124
@merrak it's a fairly standard effect i've seen in a load of other games (Vlambeer make heavy use of it) and I've got code to handle the case of actual play inserted pauses overlapping with this pause but you're right it might not be the best way to do it.

@colburt YOU BEAUTY! I was poking through the API for ages trying to find timescale changing functions. I'll give that a go! Thanks!