I’m trying to move the camera with constant speed on a dolly track.
I managed to calculate the length of the segments between two waypoints and animate the “Path Position” value based on that.
What I noticed is that when the camera is approaching the next waypoint, it slows down a bit.
All the damping values are set to 0. Am I missing something? Is there a way to bypass the easing?
If your damping is off and you are correctly calculating the required path positions, then there should be no slowing down at the waypoints. Can you attach your code that calculates the path positions? There is some interest in the Unity community for this feature. See for instance Taking fixed distance steps down dolly path - Unity Engine - Unity Discussions
Thanks
Is there an updated version of this code for Unity version 2018.3.12f1? I’m looking for some way to have the camera move with constant speed on the dolly track. I’m just learning to include custom code in my projects but when I used the script above, it had problems with:
SamplePath(path.m_Appearance.steps); // TODO: decouple numSteps from appearance setting
This is very old, and is now outdated. Cinemachine now comes with a script called CinemachineDollyCart. You add it to a gameObject, connect it to a path, and it will move with constant speed along the path.
You can have your vcam track the cart with a transposer or LockToTarget behaviour, or you can add a DoNothing vcam as a child of the cart.
Thanks Gregory, your suggestion worked like a charm. Previously, I had created the Cinemachine Dolly Camera with Track, and it didn’t have the option for the constant speed. It was like being on a roller coaster; fast on turns and going down. This motion was disorienting for VR-type apps and recordings. Using your suggestion, I created the Dolly Track with Cart, I deleted the new Dolly Track (I already had a Dolly Track created), and kept just the Dolly Cart. The script for the Dolly Cart had the Speed variable that I adjusted to get the speed just right. I set the Path to the previously created Dolly Track and Added the Component for The Cinemachine Virtual Camera (DoNothing vcam). Viola! Does what I wanted it to do. Glad to have found this thread from a few years back how Unity has evolved the product to include this functionality out of the box.
I’d like to enhance my project with a small drone flying directly in front of the DollyCart and was trying to figure out whether there’s a way for an asset to be pathed to the DollyCart, but it seems like DollyCarts and DollyTracks are just for the vcams.
The point of the dolly cart is to have something that can follow a path. It’s just an ordinary object, not tied to vcams. You can attach anything to it. Also, you can have as many carts as you like on the same path.
Very cool. Added this script (component) to the DollyCart and added my Drone GameObject as the Font Object. Working great. I’m going to have a lot of fun creating Dolly Tracks and Dolly Carts. Thanks again Gregory for the quick response.
using UnityEngine;
using System.Collections;
public class MovewithCamera : MonoBehaviour
{
public GameObject frontObject;
public float distance;
void LateUpdate()
{
frontObject.transform.position = this.gameObject.transform.position + this.gameObject.transform.forward * distance;
frontObject.transform.rotation = new Quaternion(0.0f, this.gameObject.transform.rotation.y, 0.0f, this.gameObject.transform.rotation.w);
}
}
OMG. I disabled the script, threw the gameobject below the DollyCart…held my breath, and pressed Play. It worked! I’m just blown away by what Unity can do.
There is no speed limit on the vcam if it’s following a target. You can only control the damping. To do a speed limit you would have to put a vcam in a cart and implement your own movement - or have an intermediate invisible target that moves toward your real target at a fixed speed - and have the vcam track that instead
Yes! I used a cart instead, works good… But the virtual camera noise profiles, I cant create new because create is greyed out, and I cant duplicate a preset nothing happends, and I when I mark a noise profile, I can click “gearwheel” or edit…? why have you guys locked it ?