Running Sequencer commands in code

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Running Sequencer commands in code

Post by nathanj »

Hi Tony,

I'm trying to run a sequencer command inside a script but am getting an error. Mind pointing me in the right direction?

Code: Select all

 PixelCrushers.DialogueSystem.Lua.Run("MoveTo(WLMoveTo,ImageFramer,0)")
The error:

Code: Select all

Dialogue System: Lua code 'MoveTo(MCMoveTo,ImageFramer,0)' threw exception 'Tried to invoke a function call on a non-function value. If you're calling a function, is it registered with Lua?'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:219)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:120)
PixelCrushers.DialogueSystem.Lua:Run(String) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:139)
<>c:<EnterMainCamp>b__20_0() (at Assets/_SharedAssets/Scripts/VR/VSVRCameraFramer.cs:83)
<ExecuteAfterTime>d__1:MoveNext() (at Assets/_VSApplication/Scripts/VSUnityExtensions.cs:19)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Thanks as always,
Nathan
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Running Sequencer commands in code

Post by Tony Li »

Hi Nathan,

To run a sequencer command, use DialogueManager.PlaySequence():

Code: Select all

DialogueManager.PlaySequence("MoveTo(WLMoveTo,ImageFramer,0)");
Post Reply