Hello
----------------------------------------------------------------------------------------------------------------
This Video shows me Playing the Game, entering timeline, timeline ending and then back to the game at the location where I entered the Trigger.
----------------------------------------------------------------------------------------------------------------
These are the settings I used for the video in order to make Invector, CineMachine, and Timeline work together.
I am using Invector 2.5.4 Unity 2020.1.12f1 Timeline 1.44 CineMachine 2.6.3 Universal render Pipeline 8.2.0
-My Settings
No Camera or Audio Listener in vThirdPersonCamera .. Transform X 0.42 Y 1.7 Z -1.28 >uses the Untagged Tag
New Camera Priority set to 1 transform 0,0,0 >uses the Main Camera Tag
vcam1 (used by the third person controller) Priority is set to 10, Transform 0,0,0 "vcam1 inherits the transform of vThirdPersonCamera"
*(optional) vcam2 (a Timeline camera) with Priority set as 1 transform 0,0,0
-Setup Camera's (LINK to camera setup post) >>>
invector.proboards.com/post/14660"*template version 2.5.3 or higher is required
1- Remove the Camera and AudioSource components and MainCamera tag from the vThirdPersonCamera
2- Go to Cinemachina > Create Virtual Camera and put this gameobject inside the vThirdPersonCamera, also reset the transform and rotation to 0,0,0
3- Create a New Camera in the scene and add the component Cinemachine Brain and the MainCamera tag to this object."
-Setup your Trigger collider
Create a simple cube, rename it TimelineTrigger or whatever You may want to call it.
Turn Off the Triggers Mesh Renderer in the Inspector
Edit the Triggers Collider (click on the Edit Collider symbol) to suit your scene.
Change the Trigger's Layer to Triggers and then Add Component TimelineTriggerZone.cs script (LINK to script is here) >>>
invector.proboards.com/post/14660-Setup your Timeline Trigger >Click on the Trigger
1- find On Director Play () Hit the + Sign
Add Event> vcam1 ((drag it from the Hierarchy)) >Scroll to CinemaMachineVirtualcamera >Select int Priority to 0
2- find On Director Finish () Hit the + Sign
Add Event> vcam1 ((drag it from the Hierarchy)) >Scroll to CinemaMachineVirtualcamera >Select int Priority to 10
(Note) Add Events to the Trigger to Disable or Enable your Player Main Character's Mesh, Animation Characters Mesh. Gameobjects "SetActive ()" OR use Timeline Signal to do the same thing.
-Create Your Timeline Scene
(1) Create an CinemaMachine Track for Virtual Camera of your choice
(2) Create an Animation Track & Activation Track for Your Player Prefab "prefab only requires an animator and a controller" or other characters you want to animate.
(3) Create Signal Emitters to turn on/off characters, particles, change the Weather, lighting, post processing and tons more.
*****USE Events or Timeline Signals to turn on and off
-vcam priority
-mesh's
-timeline characters
-triggers
-footsteps
-other things you may wish to enable or disable
****Do not disable the player character, just disable the player mesh". AI has trouble when disabling the player and then re-enabling.
________________________________________________________
For my Game I figured out how to do this sequence better then what You see in the Videos.
*I add the timelineteleport script and the TimelineTriggerZone to my Timeline Trigger
(1) Inspect your Timeline Trigger
next
(2) On the trigger disable your Main Character Mesh using Events on your timeline trigger so that ONLY your Animated Character is seen by cameras.
** When Timeline starts, animations of your animation character, other characters and events occurs
next
**When Timeline ends , Disable animated character mesh plus character. Teleport or start where you placed your Main Character to the position where your animation Main Character Player ended or best fits the sequence of events.
(3) on the trigger un-Hide your Main Characters mesh after timeline ends
Script I use for teleporting to the location where the animated player ended or wherever You want to Start playing again on Timeline ending.
create script timelineteleport.cs (the code is below after inspect the Trigger with the teleport script so You can add the player and teleportTarget destination)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class timelineteleport : MonoBehaviour
{
public Transform teleportTarget;
public GameObject thePlayer;
void OnTriggerEnter()
{
thePlayer.transform.position = teleportTarget.transform.position;
}
}
___________________________________________________________________
Have Fun creating kick ass Timeline Sequences then jumping back into the game.