Playmaker Forum

PlayMaker Help & Tips => iOS Help => Topic started by: QueenM56 on May 03, 2018, 06:40:42 AM

Title: How to set random float every frame?
Post by: QueenM56 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
Title: Re: How to set random float every frame?
Post by: Fat Pug Studio on May 03, 2018, 07:34:41 AM
Just loop the state into itself.
Title: Re: How to set random float every frame?
Post by: Plancksize 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.
Title: Re: How to set random float every frame?
Post by: QueenM56 on May 03, 2018, 11:33:46 PM
Thanks guys, the 'next frame even' works!

M