Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MikeTelly on June 21, 2018, 02:33:36 AM

Title: Game plays differently if Playmaker Editor is Open (on a specific FSM)
Post by: MikeTelly on June 21, 2018, 02:33:36 AM
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.
Title: Re: Game plays differently if Playmaker Editor is Open (on a specific FSM)
Post by: DennisJensen on June 21, 2018, 04:47:38 AM
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.
Title: Re: Game plays differently if Playmaker Editor is Open (on a specific FSM)
Post by: MikeTelly on June 21, 2018, 08:26:57 AM
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?
Title: Re: Game plays differently if Playmaker Editor is Open (on a specific FSM)
Post by: Mupp on June 21, 2018, 01:30:45 PM
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.
Title: Re: Game plays differently if Playmaker Editor is Open (on a specific FSM)
Post by: MikeTelly on June 21, 2018, 01:50:58 PM
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?
Title: Re: Game plays differently if Playmaker Editor is Open (on a specific FSM)
Post by: Mupp on June 21, 2018, 02:45:58 PM
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.