playMaker

Author Topic: How to Sync Player with Animator Component  (Read 5738 times)

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
How to Sync Player with Animator Component
« on: April 27, 2015, 11:47:16 AM »
Hi,
I have a player with an Animator component (and Bot Control Script, Collider and Rigid Body). On this player I have tried to do the same as the DemoWorker but it's example shows the Animation component, not the animator. I have looked at the example that uses the PlayMakerAnimatorStateSynchronization but am unsure how to integrate that into the DemoWorker demo.

Can you give me steps to replace the animation sync (and the variables animation and jumped in the variable sync repository) with the states that are shown in the Animator Syncronization demo and what the "animator sync" (vs. animation sync) FSM looks like?

Thanks,

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Re: How to Sync Player with Animator Component
« Reply #1 on: May 12, 2015, 05:43:37 PM »
I think I have this working - sort of anyways.

In my editor both the "mine" character and the other player do walk, except they walk from the input on the "mine" character, so the non-player is using the input from "mine" character. I think this is because I don't seem to even need a controller script, I disabled it and my player still walks. The script is still a component but it is disabled. The FSM "Behavior" is setting on/off the iscontrolled flag but since the component is disabled it doesn't matter. What is the purpose of the controller script anyways once you have an animator state machine - it doesn't seem to affect the movement at all?

Can someone please set me straight on what I should be using component wise?

Thanks,
Sandi

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Sync Player with Animator Component
« Reply #2 on: May 13, 2015, 06:34:22 AM »
Hi,

 Basically, you control an animator component with it's parameters, this is what you'll need to sync. Let me see if I cna find in the Unity samples a character I can use to demonstrate this.

Please bump early next week if you haven't heard back.


 Bye,

 Jean

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Re: How to Sync Player with Animator Component
« Reply #3 on: May 13, 2015, 06:23:34 PM »
Ok, that would be great.  One more thing, I have two layers. I set up two FSM (one per layer) and I have two Playmaker Animator State Sychronization Scripts set up (each one observing a different FSM, Layer Index is set) but if I try to mark Layer2's variables as Network I get an error because it won't let me set up two different network views.

Therefore I am not sure how to set up for two layers. Can you assist me with that too?

Sandi

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Sync Player with Animator Component
« Reply #4 on: May 20, 2015, 04:08:01 AM »
Hi,

 Having pushed the latest version of Pun on the Ecosystem. You can now sync your animator, physics, and transform via a series of PUN components, with no need for PlayMaker AT ALL.

 Check out PhotonAnimatorView Component for example ( they are all under the "Photon Uniy Networking/Plugins/PhotonNetwork/Views"

I am still working ont he sample, but just wanted to let you know that. So in PlayMaker you are simply left with deciding who's in control using the "is mine" action and that's it...

Bye,

 Jean

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Re: How to Sync Player with Animator Component
« Reply #5 on: May 20, 2015, 11:29:25 AM »
Wow Great. I will check it out!

gcd

  • Playmaker Newbie
  • *
  • Posts: 5
Re: How to Sync Player with Animator Component
« Reply #6 on: February 02, 2016, 03:01:41 PM »
bump :D ,
hi Jean

Did you finish the sample?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Sync Player with Animator Component
« Reply #7 on: February 04, 2016, 02:02:52 AM »
Hi,

Yes I did a long time a go actually :) follow me on twitter to not miss updates.

https://twitter.com/JeanAtPlayMaker

 I am currently yet inbetween an update ( 1.65 to 1.66) and I am trying to solve an issue on Unity 5 ( could be just me). so when you update photon make sure you backup first in case.

Bye,

 Jean