1
PlayMaker Help / Best way to combine custom C# & Animations with Playmaker
« Last post by PET on Today at 06:17:46 PM »Hey guys, long time no see!
I'm implementing (for fun) a board game in Unity.
This is a way for me to learn C#, re-learn Unity, etc.
Since board games are very State based I decided to use Playmaker to track states. Each state will call a Method that I wrote. I'm still at the beginning where I'm setting up the "Game Board".
Things generally work, but I'm getting stuck with some "best practices".
For example I have a method that will "randomly pick a game object and move it to another game object". When that happens I want to have an animation. I'm using DOTweenPro for that.
If I am to just call this Method using Playmaker, he will just do the call and then he will move on, he will not wait for the animations to complete.
So basically my core problem is now to combine Code + Animations + Playmaker Waiting before continuing.
I used ChatGPT to get some suggestions and basically I have something like this:
- Coroutine DrawClone (this will call another Coroutine DrawClonesCoroutine)
- DrawClonesCoroutine
- Playmaker Action that calls "DrawClone". I also have another Coroutine here.
This way my Playmaker Action will wait for his Coroutine to finish.
I am a bit confused about this whole thing... but the thing is that it works. The initial DrawClone wasn't a Coroutine, but ChatGPT made me make that one a Coroutine probably so the Playmaker Action knows when things finish. I think
So my main problem now is...
What is the best way to optimize everything?
I'm thinking that there will be a lot of things I want to animate and I would really like Playmaker to just WAIT for things to complete, or wait for some kind of Event.
I used a Coroutine here and not a "Event" because I can't be sure what FSM is active to receive the Event. This FSM is the GameSetup fsm, but I will use the same DrawClone Action with another FSM for example.
Any suggestions?
Thanks <3
I'm implementing (for fun) a board game in Unity.
This is a way for me to learn C#, re-learn Unity, etc.
Since board games are very State based I decided to use Playmaker to track states. Each state will call a Method that I wrote. I'm still at the beginning where I'm setting up the "Game Board".
Things generally work, but I'm getting stuck with some "best practices".
For example I have a method that will "randomly pick a game object and move it to another game object". When that happens I want to have an animation. I'm using DOTweenPro for that.
If I am to just call this Method using Playmaker, he will just do the call and then he will move on, he will not wait for the animations to complete.
So basically my core problem is now to combine Code + Animations + Playmaker Waiting before continuing.
I used ChatGPT to get some suggestions and basically I have something like this:
- Coroutine DrawClone (this will call another Coroutine DrawClonesCoroutine)
- DrawClonesCoroutine
- Playmaker Action that calls "DrawClone". I also have another Coroutine here.
This way my Playmaker Action will wait for his Coroutine to finish.
I am a bit confused about this whole thing... but the thing is that it works. The initial DrawClone wasn't a Coroutine, but ChatGPT made me make that one a Coroutine probably so the Playmaker Action knows when things finish. I think

So my main problem now is...
What is the best way to optimize everything?
I'm thinking that there will be a lot of things I want to animate and I would really like Playmaker to just WAIT for things to complete, or wait for some kind of Event.
I used a Coroutine here and not a "Event" because I can't be sure what FSM is active to receive the Event. This FSM is the GameSetup fsm, but I will use the same DrawClone Action with another FSM for example.
Any suggestions?
Thanks <3