I want my character to teleport to the mouse’s location after pressing Space then clicking the mouse. I have successfully done this without the use of clicking.
onEnterFrame = function ():Void {
if (Key.isDown(Key.SPACE)){
_root.char._x=_root._xmouse
_root.char._y=_root._ymouse
}
}
How do I make it so that I have to click after I press space? And if I press space twice it cancels the teleport completely?