How to scale character up and down with keyboard buttons?
Hi All, i have a blueprint where i want to scale my character down and up with the keyboard buttons A and E. ( Screenshot 1 ) The A and E conditions are checked by default.
This blueprint is now setup, so that when A or E has been pressed i can't press A or E again. I will make some changes to this. But for now let's go on with the way it's setup.
By default my character scale is on x1 y1 z1.
When i scale my character up with button E it works like a charm ( when my character has a scale of x1 y1 z1 i need a branch of some sort to check the scale ( Initially i don't want to scale my character up above x1 y1 z1 )
When i scale my character down with button A my character does something weird, my camera goes to the ground of the map and i can see "under the map". Like you can see in screenshot 2. What is the fix for this?
Now the thing is when i scale down my character, i need a branch of some sort again to check the scale ( initially i don't want the scale to go down below x0.5 y0.5 z0.5.
I have tryed to do this with Matinee but the Matinee does not "record" the scale down or scale up of the character.
Now i was wondering if i need to duplicate my character and make the duplicate ball x0.5 y0.5 z0.5 and somehow change characters when i press A and change back to the other character when i press E? That's not how it's done i think.
I also want the ball to go from x1 y1 z1 to x0.9 y0.9 z0.9 and so on until x0.5 y0.5 z0.5 if it's even possible? Is it's possible that would be nice.
Please show some screenshots if possible :-)
Any help is welcome,
asked May 15 '17 at 07:08 PM in Blueprint Scripting
Edit: If anyone is reading this, please ignore the huge blueprint below, and check out the nicer one I made near the bottom of the page.
Notice how in your blueprint for shrinking, you're setting the value to the current value - 1? If the current value is 1 it ends up 0. When the scale is 0 it is nothing, and this causes the camera to fall to the ground and half way through it.
Now, as for the smooth transition between sizes you requested, you need to use a tick event that keeps adjusting the size by tiny increments until it reaches it's target size.
I'll show you a blueprint I made, but first let me explain exactly what it does: It allows you to use 2 buttons to switch between just 3 precise sizes: small, medium, and large. The transition between sizes is not instant, you can see a smooth grow/shrink.
(Note: The "get max element" node I'm using returns the highest float in the vector. But in this case, the values of x, y, and z are all the same. The only reason I do this is because you cannot compare two vectors to see which is greater. I needed to use a float. If you plan on making the values of x, y, and z be different, you will have to find another way to check the values. Let me know if you need any help with that.)
For this blueprint, I created 3 variables. The one called "normal size" has a default value of true. (For the inputs, I'm using d-pad directions, but you can use A and E of course.) (Sorry the nodes are so compacted, I wanted to fit them all in frame. Just pay close attention to where the wires are going. ^^;
Follow this question
Once you sign in you will be able to subscribe for any updates here