Blueprint issues with scaling

Hey guys n girls, I have an issue and i’d like to see if anyone can solve it for me or at least help me out

I have a cube in my game which which can increase and decrease in size… when the mouse wheel is scrolled up, the cube will increase in size by 0.25 to each vector and can do this 4 times so essentially adds 1.00 to all it’s axis’s X,Y and Z. When scrolled down, the cube will shrink (-0.25) to return to it’s original size.

My issue is that I have to scroll up the maximum amount of times before I can shrink it it again, where as I would like to be able to grow and shrink with each scroll both up and down. The only way I have managed to get a cube to grow and shrink with restrictions as to size is in this blueprint below…

If anyone has an idea as to how I can achieve this cube sizing issue, please respond…!

From what I can see your whole event is based on weather the scroll up or down is at an increment of 4, so it turns off if you scrolls down 4 times and then flips back when you scroll back up 4 times. You could keep this mechanic in order to not exceed expected size. But to do the actual scaling without the bool blocking you, you should simply use +/- to your vector scale. And actually, if you don’t want to exceed expected scaling, just do a compare float from a tick event. Compare it with the x,y or z float from your vector. It doesn’t matter which since they will always be the same as each other.

I’ll post a quick example. This works for me in the way that you seem to want.

P.S. To avoid any confusion I will clarify that in the compare float function that compares with the value 2, = goes to close gate and < goes to open.

As a side thought, you could use a Tinterp To node to scale your Cube in a smoother way then then Scale 3D node. Depends on what you need.

Sorry it’s taken so long to get back, this method really doesn’t seem to like the mechanic at all. when I scroll up it seems to - vector first then + on the next scroll up .

I essentially am trying to make a cube increase and decrease in scale by “X” amount (Not to sure yet) in all vectors but so that the player can grown and shrink this cube which each input of scroll up and down. I know I need to set a maximum vector or input amount so that I can limit the maximum and minimum scale. It’s just a small part of my university project but can’t seem to get my head round the maths/blueprint needed. I’m fairly new to UE4 to be completely honest.

Thank you for replying by the way :slight_smile:

So I was just playing about with your blueprint and I have done it! with a little bit of tweaking it’s fixed and I can no scale up and down freely. Thank you so much for your help

Hey glad I could help!

Could you at least up vote my answer if it was helpful? Thanks!

I accepted his answer, because it is the answer which completly solved it. This way, other user directly find the right answer (: