0 votes

I'm trying to make it so that an enemy follows the player character and all of the tutorials I find use the phrase;

var player : Player

(which is also causing an issue because Player is not a valid type)

I would like to know when I would use : over =. An answer for how to name a specific node would be appreciated as well.

Thanks!

in Engine by (14 points)

1 Answer

0 votes

A : is used when you want to define the type of a variable, see also: https://docs.godotengine.org/en/3.2/getting_started/scripting/gdscript/static_typing.html
^
It is not used as alternative to =. |
The best you can do before I say something wrong is: Read the Docs ;) |

by (232 points)
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.