Using a funny thing called currentFrameNumber
or currentFrameName
, you can set the position of the character to the ghost as long as the object’s current frame number is greater than, lesser than, or equal to a certain number.
since you wanted this:
we just rewrite in the update script inside the character clip:
//if Ghost is playing a frame number that is greater than 3
if (Ghost.currentFrameNumber > 3){
this.x = Ghost.x; //set my position to Ghost
}
//otherwise dont do anything
The ghost clip is lacking a name, so you just give it whatever name it is if not Ghost.
… although do note that this is just one of the many solutions to this! You don’t even have to use the code up there, and just use a variable!
//inside the character clip
if (isGhost === true){// if whatever variable is true (from pressing e)
this.x = Ghost.x; //set my position to Ghost
}
Not that you can’t use my solution or anyone else’s, but there are definitely efficient and practical ones out there for more… peculiarly complex problems.
so I bid you good luck on whatever shenanigans you’re up to with your projects!