0
Answered

How to trigger a Timeline Event

Mirabel 9 months ago in Game Creator updated by Marti (Lead Developer) 9 months ago 5

Hi guys,

I've seen that Game Creator has 3 Custom Tracks for Unity's Timeline but what I want to know is how can I trigger a Timeline Event using Actions. 
Let's say I have a more complex cinematic with multiple cameras and I want to trigger it when something is done before so I want an action that calls that Timeline event (of course, after making the player not controllable, maybe a fade to black screen and so on). 

Is this possible, do we have such an Action? 

Thank you for your support!

Unity version:
2018 final
Game Creator version:
latest
+1

*I am not sure if I was clear with the Timeline "event" > throught this I mean an entire Timeline (such as a complex Cinematic)

Answered

Hi! Not sure if the event name confuses me, but Timeline has what's called Signals, which is the "arrow"-shaped marker: https://blogs.unity3d.com/es/2019/05/21/how-to-use-timeline-signals/. Are you referring to this?

If the answer is affirmative, I have good news :-) We're going to implement them in 2019.4 LTS version. In fact, it makes much more sense to be able to call an Actions object from a Signal than from a Timeline track (since the length of the track is arbitrary).

The reason we haven't yet implemented this is because Signals were first introduced in Unity 2019.1. The officially supported version is 2018.4, which doesn't have Signals. But as soon as we drop support of 2018.4 in favor of the latest LTS, we'll add Signals support.


Cheers!

Hey, I am not actually talking about that. What I actually mean is rather more simple than this. I'll explain by giving you an example:

- I want to have a trigger..which activates when the player enters a certain area

- Once the player enters the trigger I want to deactivate all controls/camera motors and switch to a Cutscene* made separately using Unity's timeline (this cutscene may contain for example 3 cameras, several characters doing certain animations and so on)

- Once the Cutscene ends I want to switch back to main camera motor for the player and activate his controls again

The Cutscene* I reffer to is done like this:

- create an Empty Game Object

- go to Timeline > press Create and save the timeline asset as a .playable 

- At this point you create animation tracks, add cameras and so on, creating an entire cutscene under the <cutscene_name>.playable previously saved file

So the actual correct question is how to call/play the .playable timeline cutscene through Game Creator.

This is not something specific to 2019, it was done by codding in older versions too.

For example, in this video the guy made a timeline play once a player entered a collider trigger.

He also made a timeline (.playable) play on awake (showing the character waking up from the floor and so on) and when the cutscene ends the Player becomes controllable.

This is what I was looking for to achieve with Game Creator, to have such an action which calls a .playable and then once the .playable ends I want to switch back to gameplay.

Sorry for the long post, I just wanted to make sure I could explain a little bit better, because initially I think I messed up by calling them "events" and so on.

+2

Thanks Mirabel for the detailed explanation. Yeah I believe this is perfectly possible using the Timeline Action. This will start playing a cutscene and will stay on hold until the cutscene is finished.

There are a few catches though. First is that, in order to remove control from the Player, you'll want to use the "Character Property" action and set the "Is Controllable" option to false.

The second one is related to the Camera. You won't be able to control the camera (I think. If you can, skip this) because the Camera is governed by the Camera Motor system. Instead, change the camera to a "Fixed Camera" Motor and move this motor for the cutscene. The main camera will emulate this one's movements.

After the cutscene is done, simply use the "Change Camera" action back to your game's Camera Motor and set the Player back to "Is Controllable"  = true.

Hope this helps and I didn't misunderstand your question again :-)