Created
October 2, 2018 06:19
-
-
Save pixelryan/55d919af1dc260889e70d67c4c633203 to your computer and use it in GitHub Desktop.
Pick a random dolly path for your Cinemachine camera. Just attach this to your camera and drag all the paths you want to choose from!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using Cinemachine; | |
public class RandomPathPicker : MonoBehaviour { | |
public CinemachinePathBase [] possiblePaths; | |
void Start () { | |
int randomPathNumber = Random.Range(0, possiblePaths.Length); | |
CinemachineDollyCart cartScriptRef = GetComponent<CinemachineDollyCart>(); | |
cartScriptRef.m_Path = possiblePaths[randomPathNumber]; | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment