Nonexistent function set_pos in Area2D

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

I was following a tutorial in youtube but godot 3.0 doesn’t have this function
in Area2D.
Is there another function with the same utility.
Sorry, English is not my first language.
I’m from Brazil and I started to learn godot today!

Stop apologizing for your English! Every sentence you said is perfectly constructed. Really, not being rude, but nobody cares if you’re Brazilian and started to learn Godot today.

jv110 | 2018-05-06 00:12

:bust_in_silhouette: Reply From: kidscancode

In Godot 3, properties were renamed from posposition, rotrotation, etc.

You also don’t need to use the setter function, you can access the property directly:

Area2D.position = Vector2(x, y)

The details are all in the documentation. See Area2D and Node2D.

Thanks, really thanks
I helped me a lot But I had a problem with the logic of the Cartesian plan as well.
I was able to solve with your tip. And I already saw your videos on the youtube!

RenatoMoran | 2018-05-06 00:27

thank you for your help.
can i ask one too, i watch tutorial at GDQuest that he wrote set_opacity() for GridVisualizer at Godot 2 (i think). and now we have Godot 3.2.

so i use set_opacity() it get error “the method isn’t declared in the current class”.

are you understand this problem too ?

alanzulwas | 2020-12-28 19:07

Opacity is controlled by the alpha (A) channel of the modulate property. You can change “Modulate” in the Inspector, or in code like this:

modulate.a = 0.5

kidscancode | 2020-12-28 19:25

Oh so i dont need to set_opacity at code right ?
because it have at inspector

alanzulwas | 2020-12-29 19:37

You can do it in the Inspector or in code, depends on what you need.

kidscancode | 2020-12-29 19:39

:bust_in_silhouette: Reply From: RenatoMoran

But I said this because many other foruns on the net, people don’t want to answer questions for people who can’t express your ideias well

You could’ve commented on your question. True, nobody is able to answer something they don’t understand, but you certainly express yourself well.

jv110 | 2018-05-06 01:33