"Expanding/Growing" A cube or circle keybind

Hello, I don’t know how to do this, I am assuming it would need to be a scale tool script that scales it to the size by clicking a keybind, let’s say Q. How would one start to set this up?

I don’t think I wan’t any transactions like animations and stuff yet.

Steps to success:

  1. read inputs from keys, set variables (such as booleans that say “Scale up” and “sacle down”)

  2. process the result of the inputs to change the transform.localScale of the target object.

Can I get a example instead? so I can learn how to do it like this?

The steps are so simple there really isn’t an example to make, and this forum isn’t about us making your scripts on call. That usually bills at about $400/hr for custom programming.

You can solve this yourself, honest. Start with the simplest coding tutorials you can find for Unity, and in the process identify how the Update() function works, how Input is gathered and assigned to variables, and how transform components (such as .localScale) are changed.

Armed with that knowledge you can write the script (it’s probably only a few lines long) and then configure your scene (or prefab if you prefer) to make such a thing happen for your precise game context. Setting up the scene to intermesh exactly the way the rest of your game needs it to is not so much coding as it is about setting things up properly, connecting stuff, and all of this the tutorials will also help you reason about.

1 Like