Page 1 of 1

Running Sequencer commands in code

Posted: Tue Apr 23, 2019 10:20 pm
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

Re: Running Sequencer commands in code

Posted: Wed Apr 24, 2019 7:53 am
by Tony Li
Hi Nathan,

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

Code: Select all

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