playMaker

Author Topic: how to sync damage in multiplayer game  (Read 3675 times)

alexlam127

  • Playmaker Newbie
  • *
  • Posts: 9
how to sync damage in multiplayer game
« on: August 08, 2013, 01:40:55 AM »
if enemy make a gun shot on me -> my hp -1

how can i do it in playmaker???


alexlam127

  • Playmaker Newbie
  • *
  • Posts: 9
Re: how to sync damage in multiplayer game
« Reply #1 on: August 08, 2013, 01:42:52 AM »
my set up

start -> networkview is mine->trigger event ->set hp (hp variable set to network sync)

network view is attached to this playmaker script.

i tried but the damage cannot be seen by others..

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: how to sync damage in multiplayer game
« Reply #2 on: August 08, 2013, 03:03:23 AM »
Are you using Photon?

alexlam127

  • Playmaker Newbie
  • *
  • Posts: 9
Re: how to sync damage in multiplayer game
« Reply #3 on: August 08, 2013, 03:12:37 AM »
im using unity default networking

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to sync damage in multiplayer game
« Reply #4 on: August 08, 2013, 03:15:51 AM »
Hi,

 have you ticked "network sync" on the fsm variable? and is the gameObject properly set up with a network view and all?


bye,

 Jean

alexlam127

  • Playmaker Newbie
  • *
  • Posts: 9
Re: how to sync damage in multiplayer game
« Reply #5 on: August 08, 2013, 04:14:53 AM »
re#5
i did both
im also wondering how to use Send remote event?
connect fsm like usual? or like using send event?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to sync damage in multiplayer game
« Reply #6 on: August 12, 2013, 04:42:08 AM »
Hi,

 I think you may be confused with the concept of network ownership and what instance of a given player should maintain, act or react to a given action from the world.

Have you studied the photon demo? even if it's not done in Unity networking, It all is very similar in the concept, so I strongly recommand you give it a go.

 Send remote event indeed work as a regular fsm event, only that it's sent across the network to reach other running instances.

bye,

 Jean