playMaker

Author Topic: How do you make a Framerate counter?  (Read 1107 times)

MatthewLalonde

  • Playmaker Newbie
  • *
  • Posts: 1
How do you make a Framerate counter?
« on: March 01, 2022, 05:43:33 PM »
Hello. I'm pretty new to playMaker. I need help with making a framerate counter, help is appreciated!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: How do you make a Framerate counter?
« Reply #1 on: March 01, 2022, 09:16:32 PM »
hi,
if its ok to update once every second you can set 2 fsms like this :

Fsm 1 :
State Start :
Next Frame event (connect state 2)
State 2 :
Int add (add to 'Frames' Variable +1 then connect back to state 1
State 3 :
Set a Global Transition on in and call it (for example) Reset.
Set in value 0 to 'Frames' Variable

fsm 2 :
State 1 :
Wait (1 sec) go to state 2
State 2 :
Get Fsm int and get 'Frames' Variable from fsm 1
Ui set text 'Frames' Variable to show on screen
send event by name to fsm 1 "Reset"
Transition back to state 1