How to not Shrink player into nonexistence


The problem: If you press down for more than half a second, your player is stuck in the quantum realm, so to speak. How do I make it so that the player cannot get that small?
size manipulation regular
size manipulation big
size manipulation quantom
I attempted to make it so that if the player’s height was above 7, it couldn’t get smaller, as you see, but that didn’t work.

Instead of setting the scale directly to the pinch maybe you can use the clamp() expression

clamp(value , low, high)

This clamps the value between the low and high.

Set object Scale = clamp(pinch scale , .5, 7)

For the key press, you can add a 2nd or condition or 3rd in your case

Up key is pressed
Height < max

Down key is pressed
Height > min

Sorry I keep editing. I’m a bit unfocused at the moment.

For the action for the keyboard events you could also add clamp or just min() or max() because you’re adding 3 and you want to prevent it from adding 3 if it’s just slightly below the max.

Instead of adding subtracting the height use equal

Something like

If up is pressed
If height < 40
Height = min(height +3, 40)

And then max() for the other direction

Could this maybe work with a boolean variable?

Okay, I tested it. It doesn’t work with boolean. How do I do it the way you suggested?

I’m not sure but I think I did it right and it didn’t do anything. Did your “min” have a infinity symbol logo on it?

Something like this

The expressions min(), max() and clamp() are mathematical tools or expressions. You can type them or use the expression builder. The button with the E like symbol.

image

2 Likes