What Simon has posted should work ok too. But I would recommend adding in some queries to prevent it from being triggered when...
a. current character is not on the current scene.
b. cursor is over a scene object.
...adaption of Simon's mouseEvent handler script.
function teleport(type, pos)
if type == eEvtMouseLeftButtonDoubleClick and getObject("Game.GameCurrentCharacter.CharacterScene"):getName() == game.CurrentScene:getName() then
if game.CurrentObject:isEmpty() then
game.CurrentCharacter.Destination = { x = pos.x + game.ScrollPosition.x, y = pos.y + game.ScrollPosition.y }
else
game.CurrentCharacter.Destination = { x = game.CurrentObject.Position.x, y = game.CurrentObject.Position.y }
game.CurrentCharacter.Direction = game.CurrentObject.Direction -- update character alignment to object.
end
game.CurrentCharacter.Position = game.CurrentCharacter.Destination -- update character position (instantly)
end
end
registerEventHandler("mouseEvent", "teleport") -- creates the mouse event handler which is handled by teleport() function
...it seems to work. It's more or less same as Simon script but it queries if current character is on current scene & if no object exists below cursor then use mouse position else jump to objects position & align to defined object position. Just add it as a definition script to the script section.
If you want to add character fade transparency in/out then you could do so by creating a called by other action & adding set character opacity action to 0% over x time > pause for x time > set character opacity to 100% over x time.