playMaker

Author Topic: How to Control the Cinemachine Dolly Cart  (Read 1107 times)

Micah

  • Playmaker Newbie
  • *
  • Posts: 30
How to Control the Cinemachine Dolly Cart
« on: September 20, 2022, 09:56:19 AM »
I am not trying to control a Virtual camera but a Cinemachine Dolly Cart. I want the Dolly Cart to follow a gameobject similar to how the virtual camera would, if it was on a path. Before I was using a Virtual Camera set to -999 so that it wouldn't effect any priority cameras. However I want the object to face along the direction of the path. The Dolly Cart does, however it needs to follow a gameobject.

I have seen on here that it can.
https://forum.unity.com/threads/dolly-to-follow-player-on-track.643957/

One of the posters says Use path.FindClosestPoint(playerPosition, 0, -1, 10) to find the desired position in path units, and set the cart's position to that.
But I can't find that in the call script or get function (Unless I'm blind).

Micah

  • Playmaker Newbie
  • *
  • Posts: 30
Re: How to Control the Cinemachine Dolly Cart
« Reply #1 on: September 21, 2022, 07:22:48 PM »
I've tried using Cinemachine's virtual camera and follow along a path. Then have the gameobject follow it instead. However, the game object does not rotate. Although there is an option to set the virtual camera, "Camera up" to "path". It does not actually rotate the camera (Which is weird), so the gameobject doesn't rotate along the path.

Micah

  • Playmaker Newbie
  • *
  • Posts: 30
Re: How to Control the Cinemachine Dolly Cart
« Reply #2 on: September 29, 2022, 05:43:49 AM »
I have Kind of resolved it. I used the cinemachine camera. A dev was kind enough to share a script that gets the rotation of the cam. I added a bit to it, so that the variable is public, then used get property in playmaker. So I don't need to control the dolly cart as a following object anymore.