0 votes

The idea behind the question is a top-down 2d RPG that is an open-world only on one scene. I want to have several area2ds with collisionshape2ds to affect certain areas when the player is entering or exiting rooms through stairs or certain entrances such as doors or cave openings. I am planning on making a large sprite (overworld) that has several similar sprites (such as inside of buildings or caves) on top of the overworld sprite with staticbody2d nodes with collsionpolygon2d attached to act as children to each of the sprites for my collisions for each of them. I am planning on using a Ysort node to accomplish the layering of the sprites on top of the overworld but I am unsure how to toggle the sprite visibility and disable/enable the collisions attached to them when the player enters or exits the area2d. Would it also be possible to set export var to which sprite the area2d is needing or do I need to create a script for every single one? Here is what my area2d with collisionshape2d script is currently set up.

extends CollisionShape2D

#this signal is attached to area2d
#not sure if this needs to be body entered or exited
func _on_Area2D_body_entered(body):
in Engine by (19 points)
edited by

Please log in or register to answer this question.

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.