+2 votes

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?

in Engine by (19 points)
reshown by

1 Answer

+1 vote

If you just need to know how to detect input, You'll need to add a key to your input. Go to Project Settings -- Input 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.

by (368 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.