Question: how do I implement this?I suppose I made a zone that the player enters, but when the key is pressed when the player is in the zone, nothing happens.My code:
extends Area
const CLOSED = 0
const OPEN = 1
var state = CLOSED
func ondoorpostanddoorareaentered(area):
if area.name == "Playerarea" and Input.isactionjustpressed("uiE"):
if state == CLOSED:
state = OPEN
$AnimationPlayer.play("Opendoor")
$Sounddooropen.play()
else:
state = CLOSED
$AnimationPlayer.playbackwards("Opendoor")
$Sounddoorclosed.play()