playMaker

Author Topic: Weird physics when changing time scale  (Read 1388 times)

Lostcity

  • Playmaker Newbie
  • *
  • Posts: 31
Weird physics when changing time scale
« on: February 18, 2015, 08:27:35 PM »
I'm pretty much done with my current project but I have one annoying bug that I can't solve. All of my enemies have a rigid body attached and they follow my player using the "Move Towards" and "Smooth Look At" actions. For the most part everything works fantastic... that is until I pause the game.

To pause the game I use the "Scale Time" action to scale the time to 0. To un-pause the game, I use the same action to scale the time back to 1.

Unfortunately, when I un-pause the game, my enemies will sometimes shoot off in a random direction (ignoring the level collisions). Changing the rigid bodies to kinematic and using interpolation had no effect. I also tried adding an FSM to all of my enemies that sets their velocity to 0 on every axis, every frame. Surprisingly, this did fix the enemies from shooting off when the time scale changed but it prevents them from having gravity (which is required for some levels).

Is there any way to make my rigid bodies not shoot off when I pause the game? Am I doing something wrong? Any help is appreciated.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Weird physics when changing time scale
« Reply #1 on: February 19, 2015, 06:46:25 AM »
Hi,

Are you sure you don't have active fsm while paused that tries to move or add forces to your objects?

Bye,

 Jean