Does lerp(a,b,C) automatically clamp C between 0 and 1?

Get help using Construct 2

Post » Sat Oct 10, 2015 3:15 pm

...or do I need to use lerp(a,b,clamp(C,0,1)) for that to happen?
B
8
S
1
Posts: 54
Reputation: 824

Post » Sat Oct 10, 2015 3:23 pm

Why don't you just try?

If you set a text to lerp(0,50,2) you get 100..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Oct 10, 2015 6:27 pm

Just guessing.... Maybe you are getting problems dealing with non-whole numbers? 0 and 1 is a hard one if you are using integers

If you are having problems with getting the fraction, you dont need to clamp anything. Just cast the variable into a float like this:

float(YourExpressionHere)

That will allow the decimal value that comes after the whole number.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests