I’m trying to do some simple math, however I do not know the function in Unity, if there is a function. Lengthdir_x and Lengthdir_y were two functions in Game-Maker, which are explained if you click the link. They find the difference to the end of the vector from the origin after giving a set length and direction. How could I recreate this?
The way your “lengthdir” methods work and the way you use them doesn’t make much sense. The value returned will always be the passed length. Since your vector always just points in one direction, it doesn’t matter what value that vector has since you normalize it. That means:
Vector2(blendAmount*3.12, 0) ==> Vector2(1,0)
Vector2(0, blendAmount*1.73) ==> Vector2(0,1)
Therefore your methods just return the passed length which is 0.5 in the first case. So you effectively pass 1.0 to your lerp method which will of course return magenta.
I’m still not sure what’s you exact goal. cyan, magenta, yellow are actually the secondary colors which are usually used when using a substractive color model like CMYK. However that colors are used in printing and work way different than additive mixing which you usually use in a RGB color model