- Home /
Remaping values?
Hi,
Is there a way to remap values? What I mean is:
Let's say we have a y var that goes from 0 to 360. I want to "reamap" this into a new var that range from say 0 to 1. So that 0 of the y value is equal to 0 of the remapy value and 360 of the y value is equal to 1 of remapy. Even better, able to remap to -1 to +1?
Thanks for any advice and help on that.
Comment
Best Answer
Answer by Piflik · Sep 15, 2011 at 02:32 PM
Map to (0,1):
x = y/360;
Map to (-1,1):
x = y/180 -1;
....Sometimes I try to go from Greece to England by passing through Japan. Thanks Piflik
Your answer
![](https://koobas.hobune.stream/wayback/20220612213405im_/https://answers.unity.com/themes/thub/images/avi.jpg)