+2 votes

Hello again.
I have scene "door"
enter image description here

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:
enter image description here
So, I needed to make it open when "paul" is entering to its Area2d.
Thats how i made it in a code:
enter image description here
But it doesn't work!
P.S.: No need to say me about examples, please.

in Engine by (29 points)
edited by

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

nothing happened :(

Did you mispelled KinematicBody2D in your path?

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

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?

2 Answers

0 votes
Best answer

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

by (29 points)
+1 vote

Like our friend Zylann said: Did you mispelled?

you write KinemticBody2D missed the a

by (429 points)

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

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 Frequently asked questions and 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 [email protected] with your username.