Skip to content

Instantly share code, notes, and snippets.

@gekidoslair
Created April 30, 2018 16:59
Embed
What would you like to do?
Activate a Unity Timeline from a trigger
using UnityEngine;
using UnityEngine.Playables;
public class GenericTrigger : MonoBehaviour
{
public PlayableDirector timeline;
// Use this for initialization
void Start()
{
timeline = GetComponent<PlayableDirector>();
}
void OnTriggerExit(Collider c)
{
if (c.gameObject.tag == "Player")
{
timeline.Stop();
}
}
void OnTriggerEnter(Collider c)
{
if (c.gameObject.tag == "Player")
{
timeline.Play();
}
}
}
@jaaacccobdev
Copy link

when my player walks to the trigger nothing happens can you help please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment