+1 vote

How to shorten this code?:

$Sprite.position.x = 2
$Sprite.position.y = -3 

I tried this, but it didn't work:

$Sprite.position = (2,-3)
Godot version 3.2.3.stable
in Engine by (142 points)

1 Answer

+1 vote
Best answer
$Sprite.position = Vector2(2,-3)

Your code does not know what to do with your (2,-3)
Codes are like toddlers, stupid, you have to tell them everything, in this case, you have to tell it's a Vector2 and not something else.

by (143 points)
selected by

I just forgot to add Vector2, thanks!

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.