Making doors in 2d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By JowannoSebastiano
:warning: Old Version Published before Godot 3 was released.

Hello again.
I have scene “door”

this is how it looks in node tree.

So it has one animation “open” which include 6 frames and 2 collision keys (In a first frame is toggled on and in sixth is toggled off)

I instanced this scene to the main scene and it looks like this:

So, I needed to make it open when “paul” is entering to its Area2d.
Thats how i made it in a code:

But it doesn’t work!
P.S.: No need to say me about examples, please.

Maybe you need to remove the Node2D/ part of the node path?

Bojidar Marinov | 2016-03-30 11:25

nothing happened :frowning:

JowannoSebastiano | 2016-03-30 11:43

Did you mispelled KinematicBody2D in your path?

Zylann | 2016-03-30 11:44

I would also recommend to add Area2D inside your door’s scene (like you did with KinematicBody2D).

Kermer | 2016-03-30 19:32

I suggest you come up with a technique where you don’t need to type such long node path names. find_node() might be a start. Wouldn’t find_node("anim_door").play("open") work here?

duke_meister | 2016-03-30 20:59

:bust_in_silhouette: Reply From: tiernich

Like our friend Zylann said: Did you mispelled?

you write KinemticBody2D missed the a

BTW, in future answers/comments, please write @UserName, instead of “our friend UserName”

Bojidar Marinov | 2016-03-30 17:26

:bust_in_silhouette: Reply From: JowannoSebastiano

The answer was simple guys.
It was needed to make a collision for area2d node, like this: