How to change radius of orbiting object?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dikawfa

Hi, i’m new to game development and i hope anyone can help me.
So I was following this tutorial Circular movement to make an orbiting object.

Now, i want the orbit radius increase when player presses a key, then go back to its default radius when player release the key. Anyone can help how to achieve that?

:bust_in_silhouette: Reply From: Millard

If you just need to know how to detect input, You’ll need to add a key to your input. Go to Project SettingsInput Map. Then in the Action bar, you need to type in the name you want for the key, and press Add. Then, scroll down in the list, until you find the key you just added, and press the plus sign. then, add the key you want. Then, you can use the is_action_pressed("name of your Input key") to check if your key is down. This may be enough, but depending on your code, you may also need is_action_just_released("name of your Input key") too. If this isn’t clear, or this isn’t what you’re having trouble with, please comment.

Okay, maybe my question is not clear enough…
My main problem is to change the radius of the orbiting object, not to detect input.
anyway thanks for your response

dikawfa | 2020-10-17 01:05