Cinemachine for flythrough videos.

I’m working on a flythrough video and would like to find out how to aim the camera along a path. I already have a CM vcam moving along a DollyTrack, but I don’t want it to aim at a particular object.

BTW, it would be great to have an example scene or a tutorial about using Cinemachine for flythrough videos. I know it’s probably the simplest use case, but there are some things that are not so obvious for beginners like myself:)

Have you tried creating animation for the CM vcam where you would just animate it’s rotation?

Very easy. Don’t set a LookAt target on your vcam. Set the CameraUp setting in TrackedDolly to Path. The effect will be that of a rigid camera rig on a track.

2 Likes

Thanks for such a quick response! It works, but the camera does some fancy moves at each waypoint: it switches 180 degrees and then slowly turns back 180. What do you thing I missed?

Also, is it possible to adjust a Dolly Track as a bezier curve to make the camera move more smoothly? Sorry for such basic questions. I’m really new to Cinemachine.

The railroad-tracks in the path give an indication of its smoothness. If they wiggle around, then so will your camera. Place the waypoints carefully and evenly, and adjust the tangents with care to make the path smooth. It’s just a bezier under the hood.

Each waypoint has a roll setting, so that you can bank the track. Note that there are options in the CameraUp setting to remove roll, if that’s what you need.

Greg, what if I just wanted a smooth curved path on a flat surface? No rolls. Is that possible?

Yes it’s possible. Put all waypoints and tangents in the plane. Set the roll in all waypoints to 0. Or use the CameraUp “PathNoRoll” option.

1 Like

Thanks again. You’ve been really helpful! I’m getting a hang of making smooth Dolly Tracks now. Any way to create them programmatically or better yet import a path created with other software (Illustrator, Blender, etc.)?

You can create them programmatically by adding waypoints to the waypoint array. Currently Unity does not provide an importer for these paths, but you could always write one :slight_smile:

Is there an API call for that?

Sure. CinemachinePath.m_Waypoints is the array that holds the waypoints. Manipulate it as you like.

Wow! That’s great. BTW, do you think NURBS-based dolly track would be useful? I’ve heard that NURBS provides smooth paths by default. I know bezier is more versatile, but I think most people would want a smooth dolly track any way.

CinemachinePath inherits from CinemachinePathBase. The TrackedDolly behaviour can be hooked up to any path that is derived from CinemachinePathBase. You can write your own path class implementing NURBS, or an imported path, or whatever you like. Let us know if you come up with something cool!

@username132323232 NURBS are cool but they can be really fiddly in practice since the path doesn’t go through the control points like it does with beziers

I’ve found that you get a bit more smoothness right away with NURBS but then they start to drive you crazy because you’re only indirectly defining the path position instead of directly with a bezier method.

If you do go down that road, please let us know how it goes

Thanks Adam. I see what you mean and I agree. It does look like bezier is more appropriate than NURBS. I’m just starting with Cinemachine (which super-cool!) and hopefully will get better with using the waypoint tools :slight_smile: If I wanted to add some functionality (like automatic path smoothing), which script file would I need to work with?

Also, I think in many cases it would be easier to build the dolly track in 2D (fixed Y) and then expand it to 3D if required. How about adding a “lock” option for each axis coordinate and tangent?

Everything you need is in CinemachinePath.cs and CinemachinePathEditor.cs.

Thanks Gregory! I’m working on a bunch of other stuff right now, but can’t wait to jump on CinemachinePathEditor.cs. It should be fun :slight_smile:

Looking forward to see where you take this :slight_smile: