playMaker

Author Topic: Game plays differently if Playmaker Editor is Open (on a specific FSM)  (Read 2028 times)

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Not exactly what could be causing this. Simply put, if I have the editor opened on a certain FSM during play mode, the jump of my 2D character changes. It's as if the gravity suddenly went down.

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Hey,

It's probably because your game is depending on the FPS and the FPS drops when you are viewing your FSM real time.

If you add a force every frame and it suddenly only shows 10 frames instead of 30 frames then it causes that problem.
Game Designer, CEO, Artist
http://2ndStudio.com

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Hey,

It's probably because your game is depending on the FPS and the FPS drops when you are viewing your FSM real time.

If you add a force every frame and it suddenly only shows 10 frames instead of 30 frames then it causes that problem.

Oh so I need these things to happen in FixedUpdate correct? How do I make that distinction in Playmaker?

Mupp

  • Full Member
  • ***
  • Posts: 167
There will be a check box on the actions that are able to do their thing in fixed update.

Remember though that if you move your character using Unitys physics engine it will always move it outside of fixed update even if the action is set to fixed. This will cause a difference in movement at different frame rates (it's ass for precision, don't use it). If you check kinematic in the rigid body settings and your character does not move, then you are using the physics engine to move it.

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Remember though that if you move your character using Unitys physics engine it will always move it outside of fixed update even if the action is set to fixed. This will cause a difference in movement at different frame rates (it's ass for precision, don't use it).

...So how am I supposed to accurately move my character?

Mupp

  • Full Member
  • ***
  • Posts: 167
Well, the way I did it was, first, checking the kinematic button on your character, then creating a FSM for moving your character using translate on fixed update.

Translate moves your character a fixed distance on every update so you need to figure out a system that mimics gravity and acceleration on the XY axis, things that the Unity physics engine is supposed to do for you. I can't tell you how to do that though since it's specific for what you need. I use a variable that stores a desired "fake velocity" number when you press left or right, then I divide it to a very small number and set it on translate X axis.

But for me this way gave me consistent jump heights and other physics things during low frame rates.