Articy Forum


https://www.articy.com:443/forum/

Articyflowplayer - start / stop / continue in Unity

https://www.articy.com:443/forum/viewtopic.php?f=46&t=18606

Page 1 of 1

Articyflowplayer - start / stop / continue in Unity

Posted: Thu 11. Jul 2019, 08:46
by k2022
Hi all,

I am using Articy to export to Unity and I am trying to get to grips with the flowplayer.

I'd ideally like to play a flow (dialogue) - pause the flow - have the player interact with the game - restart the flow.

I have created a custom flowfragment for the 'pause' . Is this a valid approach? Any tips would be appreciated on how to stop / start the flow in C#.

I'd also like to create the flowplayer from code rather than set the StartOn from the Unity UI.

Thanks!

Re: Articyflowplayer - start / stop / continue in Unity

Posted: Fri 12. Jul 2019, 08:44
by [Articy] Nico Probst
Hi k2022,

currently it is not supported to manually pause the flow, because the flow traversal is done as quickly as possible, so there wouldn't be really time to pause "in between". When the flow player pauses it pauses on node types you marked in PauseOn. If you don't want to traverse the flow just don't call Start again after one of those pauses. If you check our demo project "Maniac Manfred" you will see this in action: When you click on something a dialogue might appear, driven by the flow player, and after the last sentence the dialogue UI disappears but the flow player is still pausing at the last node. I you still need a pause, your approach should work just fine, remember: Everytime a node type is hit on traversal that is in PauseOn the flow player will not continue traversal until you call StartOn again or any Play() method.

I'd also like to create the flowplayer from code rather than set the StartOn from the Unity UI.


This sounds like two different questions: You can create the ArticyFlowPlayer Component from code with unitys AddComponent() and you can call StartOn in code just as well, but be careful to not use the field startOn in Code please use StartOn with a capital S.

Hope that helps

Best regards

Nico

Re: Articyflowplayer - start / stop / continue in Unity

Posted: Sun 14. Jul 2019, 07:17
by k2022
Hi Nico.

That makes sense and everything is now working apart from the fact that the OnFlowPlayerPaused method seems to be called continuously (every frame?) during a Pause while the player is interacting with other parts of the game.

Is this by design or is something going wrong?

Thanks

Re: Articyflowplayer - start / stop / continue in Unity

Posted: Tue 16. Jul 2019, 11:43
by [Articy] Nico Probst
That makes sense and everything is now working apart from the fact that the OnFlowPlayerPaused method seems to be called continuously (every frame?) during a Pause while the player is interacting with other parts of the game.


This happens if you have ContinouslyCalculateBranches enabled, we still debating internally if it should only call OnBranchesUpdate or both. If you need that flag, make an early out in the FlowPlayer checking the ID of the paused object.

Hope that helps

Best regards

Nico

Re: Articyflowplayer - start / stop / continue in Unity

Posted: Wed 17. Jul 2019, 06:28
by k2022
Yes - that answers my question.

Thank you for your help!!

All times are UTC
Page 1 of 1