Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mekoid on December 10, 2014, 10:48:48 AM

Title: [SOLVED] Floor / Ceiling??
Post by: mekoid on December 10, 2014, 10:48:48 AM
Hi I am new to Playmaker.
I need some math functions such as "floor" and "ceiling".
I couldnt find any actions that can do those.
Any ideas please?
Thanks a lot!
Title: Re: Floor / Ceiling??
Post by: Merto on December 10, 2014, 11:17:12 AM
If by floor and roof you mean something that blocks a number from going lower or higher, here's an artificial one I created with the compare action:

(http://i.imgur.com/RTk36X7.png)

(http://i.imgur.com/7sQiaE1.png)

So that's a roof. Basically if the float variable's number goes higher than 1, it sends the roof event. Then the roof event sets the float variable's number back to 1 and it can't go higher.
Title: Re: Floor / Ceiling??
Post by: mekoid on December 10, 2014, 11:49:02 AM
Hi Metro
Thanks for your reply. The actions that you did seem not enough to what I need.
I have a variable that changes with player's frequent inputs.
And I need to change the variable to its floor or ceiling value.
For example, when the value is 1.5 and the player presses up, it needs to become 2 , if the player presses down, 1.
And the value can be anything > 0.
So any other ideas?
There should be an action to customize math function for the variables....
Title: Re: Floor / Ceiling??
Post by: Lane on December 10, 2014, 12:01:14 PM
http://hutonggames.com/playmakerforum/index.php?topic=8954.0
Title: Re: Floor / Ceiling??
Post by: mekoid on December 10, 2014, 12:48:54 PM
AH~~
Awesome!! Thanks very much.
But very strange I couldnt find it previously...
Title: Re: Floor / Ceiling??
Post by: Lane on December 10, 2014, 12:53:50 PM
I just made them when I read this post. ;)