playMaker

Author Topic: How to set random float every frame?  (Read 3105 times)

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
How to set random float every frame?
« on: May 03, 2018, 06:40:42 AM »
Hi,

I'm working on a 2D ios game and come across a problem with random float.
Please see attached image...
I want to store a random float variable, so an object will appear at random height.
It seems require to save it for every frame.
But there is no option for it.
Can anyone help to solve the problem?
Cheers,
M

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: How to set random float every frame?
« Reply #1 on: May 03, 2018, 07:34:41 AM »
Just loop the state into itself.
Available for Playmaker work

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: How to set random float every frame?
« Reply #2 on: May 03, 2018, 10:04:27 AM »
Just like the previous poster said, loop it into itself. You can use a "Next Frame Event" action at the end of the state to make it run once per frame.

QueenM56

  • Junior Playmaker
  • **
  • Posts: 55
Re: How to set random float every frame?
« Reply #3 on: May 03, 2018, 11:33:46 PM »
Thanks guys, the 'next frame even' works!

M