Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | venam |
hello im new to godot and im trying to make an 2d rpg my player is able to change scenes area1d and collision2d nodes which are placed over my door scene instances i would like to know how i can set the players position so she doesnt enter and end up in the middle of the room id also like to play the door animation when “e” is pressed
extends Area2D
var entered = false
func _on_body_entered(body):
entered= true
func _on_body_exited(body):
entered= false
func _physics_process (delta):
if entered == true:
if Input.is_action_just_pressed(“e”):
get_tree().change_scene_to_file(“res://Scenes/PlayerRoom.tscn”)