Search Unity

Question Need guidance on timeline animation

Discussion in 'Timeline' started by tleylan, Apr 17, 2023.

  1. tleylan

    tleylan

    Joined:
    Jun 17, 2020
    Posts:
    621
    My very simple test worked but I don't think I'm doing things the best way. I have a sailing ship model in my scene. I would like players to be able to get on board and (when I press a button) the ship sails out of the port, around the island and back into the port.

    I found info about Timeline and created one and crudely adjusted the position and rotation of the ship at certain points and I can play that back. Now how do affect a smooth transition between these things? Ideally I the ship would transform position and rotate simultaneously as it circles the island (missing a reef or two).

    I don't know if I make a bunch of short clips (this would seemingly let me replace a bad spot). Should I enter predetermined values in the inspector? I'm not so good at dragging objects but I'm horrible at rotating them on the first go.

    Thanks.
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Have you looked at Dolly Cameras? You can create a spline curve and a "cart" will follow that path. While it is intended for cameras, you can put anything inside. You can define a few waypoints and it will then move the game object smoothly between the waypoints (including rotation). And it works with scrubbing in the timeline during debugging etc.
     
    tleylan likes this.
  3. tleylan

    tleylan

    Joined:
    Jun 17, 2020
    Posts:
    621
    Nope :) But I am definitely looking at it now. Watching a video, hope I can figure this out. Thanks.

    I watched a few videos they are a little ambiguous for a beginner. I understand that it can be used to dolly/track a camera like a movie being made. That's not my goal. I do see that you can dolly/track a gameobject which is clearly what I am after.

    I have a dolly track and dolly cart added as children of my ship. I don't see how to generate a path such that the ship can follow it. I see a CinemachineSmoothPath and I can add a CinemachinePath instead. Don't know which one I want.

    Do you know of any introductory tutorials that would demonstrate it step-by-step?

    I managed to generate a path and the cart follows it and my ship is a child of the cart so for now it is working.
     
    Last edited: Apr 19, 2023