Choosing a map Key with an inrange Inter?

Hey there,

Im trying to cut down nodes.

These are 2 examples of fixes to show an image.

I started with a child/parent system but it would eventually have like 100 children every time the image changed.

I changed it to visibility and inrange nodes but it means having 10 or 20 images in my designer view.

I swapped it to finding the image in a map using inrange nodes which cuts down the image but leaves you with this never ending stream of nodes.

So now Im trying to condense it further like a puzzle game.

This is as condensed as I feel I can get, I just dont know how to connect these.

Basically I want to choose the fat amount and related image based on body fat.

Which sounds easy but the fat could be anywhere from 0-20.

Im a bit stumped.

Thanks guys. enjoy the puzzle

Huh so body fat goes 0-20, how many images do you have?

Are you trying to map intervals to images, such as 0-5 = image1, 6-10 = image2, 11-15 = image3, 16-20 = image4 ?

Or something different ?

Good morning bro.

Sorry I must of been tired :laughing:, It goes to 100.

But the range is 20 a piece atm but your exactly right on the concept.

theres currently 5 stages of weightclass.
0-19/20-39/40-59/60-79/80-100

and each has a related image thats shown when bodyfat is in that range.

So the question is how do I pick key that isnt based on a specific number?

Eg. if the key says 19 or below = low body fat image. itll only show specifically on 19, and not everything between 0-19

Hopefully it makes sense. :grinning:

Well then simply divide by 20.

If you really need to include 100 (in the 5th range), also clamp the result so it doesn’t overflow.

You can also do this which may be even simpler if you don’t need it anywhere else

3 Likes

Absolute clutch.

Yeah this is exactly what I was hunting. :trophy: :trophy:, I got so hooked on the modulos node lol.

Im going to use the second one as It allows me to get rid of some variables and cut some more nodes out elsewhere.

I adore the puzzle of condensing blueprints. Satisfying.

Thank you! Its perfect.