Skip to content

Is it possible to use greater than inside interpolate function? #6217

Answered by MatiPl01
itsnyx asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for explanation. You can do a little trick in here based on the knowledge from my previous comment.

Explanation

If you want your interpolated value to be constant when it exceeds your input range (in your case it must be always a constant number but different for different input values), you have to use Extrapolation.CLAMP as the last parameter of the interpolate function call.

This is the default behavior of the clamp extrapolation:

What you are trying to achieve is just a different version of this example with a single-value input range. Something like this:

You have 2 possible solution to achieve the desired effect:

Solution

  1. Use the input range where the second value is sligh…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@itsnyx
Comment options

Answer selected by itsnyx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants