- Home /
CineMachine without Timeline?
Forgive me for such noobness. My question is I want to run a Virtual camera based on user input. I have three virtual cameras and I dont know how to do this simple task. And If you know how you could control time line based on User input that will be great.
can you explain what behaviour you want to achieve exactly? yes, you can control virtual cameras without timeLine, also you can play-pause-stop and change playback speed of timeline. we can give advise if you share more content.
I have 3 virtual Cameras. I just want to switch my main camera on those three positions via code.
Answer by NorthStar79 · Jan 04, 2018 at 09:25 AM
for changing virtual cameras in code, you can adjust their priorities.
okay here how you can change virtual cameras in code.
using UnityEngine;
using Cinemachine; //do not forget include this
//assgin your virtual cameras in inspector.
public CinemachineVirtualCamera[] Cameras;
int index =0;
void Update () {
if(Input.GetKeyDown(KeyCode.Space))
{
Cameras[index].Priority =1;
index++;
index = index%Cameras.Length;
Cameras[index].Priority =10;
}
every time you press "Space" camera should change.
Thanks for Answer. One more thing if we want to Activate a specific camera from the list?
Your answer
Follow this Question
Related Questions
Switching between 2D and 3D in the same Scene 2 Answers
Player Looking Rotated in Perspective Camera 0 Answers
How to use two cameras in VR to display 3D object on top of UI panel? 0 Answers
Camera Movement and angles 2 Answers
Camera display specifications,2D visuals in a 3D game with camera issues 0 Answers