Quantcast
Channel: Questions in topic: "interpolate"
Viewing all articles
Browse latest Browse all 93

Get a value that interpolates between two floats based on where character is facing

$
0
0
I'm making a controller script for a paper airplane and I'm currently stuck on trying to make the plane gain speed when facing down but lose speed when facing up. The ideal way would be having a `value` that's 0 when facing right or left but drops to -1 when facing up and 1 when facing down (It doesn't really matter which is 1 or -1 just that they're distinguishable). Then I'd just multiply that `value` (which is somewhere in between -1 and 1) by `gain` and add that to my speed variable like this `speed += value * gain`. Here's a picture to better understand. I already got the information where the plane is currently facing (both in vector form and degrees) but how can I do this? ![alt text][1] [1]: /storage/temp/75591-untitled-2.png

Viewing all articles
Browse latest Browse all 93

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>