Forum rules - please read before posting.

Timeline. Teleport player and return back.

Hello everyone.

I have a question. I'm using Adventure Creator for a 2D game.

I've created a cutscene at the beginning of the game using Timeline. It's launched by an ActionList that waits for it to finish.

During the cutscene, the Player object needs to be instantly moved (teleported) to a specific point where an animation will play, and then at the end of the cutscene, it needs to return to its original position.

The issue is with this teleportation. I'm using a Signal Track in the Timeline to send a signal, which calls an ActionList (I'm using ActionList.Interact()). Inside this ActionList, I call Object: Teleport. However, on the very next frame, the object returns to its old location.

The situation is the same if I use the signal to change transform.position.

Changing the Player's "Motion Control" to "Manual" also doesn't help.

Interestingly, if I call Object: Teleport from the main ActionList, everything works fine.

How should I approach this?

Thanks in advance.

Comments

  • Welcome to the community, @mkudimov.

    Is the teleport operation you're describing the one that's moving the Player to the new position, and is the character affected by any other Timeline tracks at the time?

    Rather than using a signal, try setting the position with an Animation Track.

  • Thank you.

    I found problem myself. What happend:

    I made an animation that moved the root of an object and launched it inside Timeline. After that, everything broke: the object did not want to move using Adventure Creator.

    Even if the animation ended
    Even if the cut-scene in the timeline ended
    Even the usual movement of the player using NavMesh.

    It could be fixed if you turn on the "root motion" flag on the player, but something tells me that this is not quite right.

    What I learned from this is that never touch the root movement during animation... Or I'm not cool enough to understand how this can be used.

  • It should be possible without the use of Root Motion - which indeed, should be left alone whenever possible.

    Are you using a separate Animator on the Player's sprite child to control their regular animation, to the one on the root used by Timeline? I just attempted a recreation and was able to get a teleport to and from their original position. What is necessary, however:

    • Check Wait until finish? in the Action
    • If the Player is spawned in at runtime, check Remap bindings? and assign the Player to the track that affects them
    • For the Player to teleport back, you'll need to end the Animation Track that repositions them before the Timeline itself reaches its end.

    If you can share screenshots of your setup, I can try to spot where the issue lies.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.