Playmaker Forum
PlayMaker News => General Discussion => Topic started by: jgalvezpa on January 15, 2014, 11:43:18 PM
-
Hi im using perlin noise action to give random movement to my objects also using add force 2D, the problem is that perlin noise only give positive value 0-1, they add random movement but they always look to be moving in the positive side of screen, could you tweak perlin noise action to -1 0 1 something like that,
i could multiply it for negative value, but then the force only will be in negative side.
-
Why not just:
x = random (0..1)
x = x - 0.5
x = x * 2
-
Heya,
I think the easiest way would be to use Jean's awesome float remap action:
http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311 (http://hutonggames.com/playmakerforum/index.php?topic=5122.msg24311#msg24311)
Simply map your 0 - 1 range to -1 - 1 :)
Cheers,
Simon
-
Hi,
yes, this float remap should have been better worded, the right mathematical term is cross multiplication:
http://en.wikipedia.org/wiki/Cross-multiplication
bye,
Jean