Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to soften twists and turns to change the speed during movement?

Discussion in 'Cinemachine' started by svetlanaaksenova05, Oct 22, 2020.

  1. svetlanaaksenova05

    svetlanaaksenova05

    Joined:
    Oct 14, 2020
    Posts:
    11
    Hello everyone!


    My problem is that I don't understand how to make a soft turn when turning and change the speed of the camera while driving.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    Can you give some context? What is your current vcam setup? What is your target? How is the target moving? What is the camera doing now and what would you like it to do instead? Showing the vcam inspector would be helpful.
     
    svetlanaaksenova05 likes this.
  3. svetlanaaksenova05

    svetlanaaksenova05

    Joined:
    Oct 14, 2020
    Posts:
    11
    Thanks for u answer.
    I want to smooth out turns on Dolly and change the speed while driving.My camera tracks a moving car.
     

    Attached Files:

  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    (you gave the same screenshot twice, probably by mistake :))

    Do you use a dolly cart to move both the target and the camera? The cart will move at the speed you set in the inspector. You have to change that field smoothly in order to change the speed.

    Is it necessary to have the camera on a dolly track? It might be easier to make a virtual camera that just tracks the car without being on a dolly track. Can you show the inspector for the virtual camera?
     
  5. svetlanaaksenova05

    svetlanaaksenova05

    Joined:
    Oct 14, 2020
    Posts:
    11

    Yes, the camera and the car have different paths, but they move through Dolly.
    I can't ask the question correctly.
    I know how to change the speed on Dolly, but I don't know how to change the speed as you go. For example, 3 waypoints speed 3, 5 wp speed 6.
     

    Attached Files:

  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    You would need to add some logic that sets speed according to path position. Perhaps a custom behaviour with and array of items { path position, speed }. It monitors the current path position, and updates the speed according to its data.