hi so I am making a game where you can press a button to interact with someone and I tried this code and it is not working. If anyone has any ideas please help.
function keyPressed(key){
if(this.hits(player)) {
this.gotoAndStop("press");
if(key === "space"){
gotoAndStop(6);
}
} else {
this.gotoAndStop(1);
}
}