Hi!
I am working on a 3D configurator for outside props.
Using FlowCanvas, I have created a scene in which I rotate around a static 3D model, using the mouse.
The zoom is handled by a Z-axis translation of the main camera itself.
Using Cinemachine and Timeline, I have set up a cutscene with 5 virtual cameras, moving around the static 3D model. The start position (Virtual Camera 1) is the same as the ending position (Virtual Camera 5).
The CinemachineBrain is located on a sub camera, configured to hide GUI elements.
I am also using a homemade script to cancel any input from the user while the cutscene is playing.
When pressing “P”, the Timeline start and so is the cutscene.
The problem I am facing is that I want the actual position of the main camera, when pressing “P”, to be both the starting and ending point of the cutscene.
I might haven’t search the right way, and I am kinda block on this one. I tried to “cheat” a little, trying to set up fade in/out but I’ve messed myself up with it and end up here, asking for what I think to be the most flexible solution.
A short video to illustrate my words
The sub camera object
The Timeline
The StartCinematicMode.cs
```csharp
*using System.Collections;
using UnityEngine;
using UnityEngine.Playables;
using FlowCanvas;
public class StartCinematicMode : MonoBehaviour
{
#region Cinematic Logic
[SerializeField] FlowScriptController rotationFlowController;
[SerializeField] FlowScriptController cameraFlowController;
[SerializeField] private GameObject mainCamera;
[SerializeField] private PlayableDirector myDirector;
#endregion
private void Start()
{
rotationFlowController = mainCamera.GetComponent();
cameraFlowController = mainCamera.GetComponent();
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.P))
{
StartCoroutine(PlayCutScene());
}
}
IEnumerator PlayCutScene()
{
// disable rotation logic
rotationFlowController.enabled = false;
cameraFlowController.enabled = false;
// disable the main camera
mainCamera.SetActive(false);
myDirector.Play();
// wait for the timeline sequence to end
yield return new WaitUntil(() => myDirector.state == PlayState.Paused);
mainCamera.SetActive(true);
rotationFlowController.enabled = false;
cameraFlowController.enabled = true;
}
}*
```