Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | JowannoSebastiano | |
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
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