Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MrMitch on July 04, 2013, 04:47:39 AM

Title: invert numbers[SOLVED]
Post by: MrMitch on July 04, 2013, 04:47:39 AM
I'm trying to figure out a way to make a positive value be read as a negative and a negative to be read as a positive, so 1.23 would be -1.23 and vice versa

Any suggestions?
Title: Re: invert numbers
Post by: escpodgames on July 04, 2013, 05:04:22 AM
Easy, use the float sign test action and transition into 2 states with remove or add the initial value from zero.
Title: Re: invert numbers
Post by: MrMitch on July 04, 2013, 05:40:44 AM
Thanks I'll have a look at it when I get home
Title: Re: invert numbers
Post by: MrMitch on July 05, 2013, 05:19:13 PM
Ok so that does work for the system i have it just doesn't give me nearly enough control over the system.

I'm trying to get the device tilt and move a sphere(using force) using the tilt, i have managed to get it to read as 0 when my device is held landscape left but to do this i had to set the orientation to Portriat in Get Device Roll but the main problem is the values are reversed so when i tilt left i get positive numbers and when i tilt right i get negative numbers, i have tried using Float Compare  and setting up several stages of movement speed but for some reason Float Compare doesn't seem to fire off at all.

Are there any other ways to compare float?
Title: Re: invert numbers
Post by: escpodgames on July 05, 2013, 06:31:45 PM
Device roll :S Check out this thread - http://hutonggames.com/playmakerforum/index.php?topic=3470.0

There are currently issues with device roll ... and this could be your issue?! maybe

Also make sure it's set to everyframe? otherwise it's impossible to tell why it's not working without seeing the setup.
Title: Re: invert numbers
Post by: Alex Chouls on July 05, 2013, 06:42:00 PM
I'm trying to figure out a way to make a positive value be read as a negative and a negative to be read as a positive, so 1.23 would be -1.23 and vice versa

Any suggestions?

Use Float Multiply and multiply by -1
Title: Re: invert numbers
Post by: escpodgames on July 05, 2013, 08:12:56 PM
Haha, Oh man! that is a much easier method ... ignore me :D
Title: Re: invert numbers
Post by: MrMitch on July 05, 2013, 09:08:43 PM
Thank you so much Alex it works perfectly now :) and thanks for trying LampRabbit :)