playMaker

Author Topic: Photon rigibody2dview for jumping and running?  (Read 2204 times)

RC

  • Full Member
  • ***
  • Posts: 148
Photon rigibody2dview for jumping and running?
« on: March 01, 2015, 11:44:53 PM »
Hi,

Im having some difficult time trying to figure out how to sync a smooth jump over photons network.
The problem is, when I jump ts very jerky over the network.
I'm probably syncing the jump wrong.
But doesn't it just grab the position of my character and sync it over the network?
Still confused so I have been searching and found this on Photons site.

rigibody2dviewto sync that would work perfect because its syncing velocity?
http://doc.exitgames.com/en/pun/current/tutorials/d-jump-and-run

I have downloaded the original photon free network from unity asset store included the scripts, but I'm clueless on how to put that in playmaker.

I also have played around and use most of the stuff from playmaker photon demo and sample scene.

My control for the jump is just a force2d action 500 on the Y axis  when spacebare is pressed..

If anyone have a script to grab velocity and syncing it could share it here. I would greatly appreciated.
Thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon rigibody2dview for jumping and running?
« Reply #1 on: March 02, 2015, 12:24:42 AM »
Hi,

 You may have a conflict between a photonView that sync the transform and a RigidBodyView.

Could that be the case on your prefab?
 
The other likely issue is that you add force on both the owner and the slave. When the action "Is Mine" return true, you are supposed to control the gameobject, add force etc, but when the action "Is Mine" returns false, you are supposed to let the various photon view component do that job.

So, are you positive that you don't add force to the slaved prefab instance?

 Bye,

 Jean

RC

  • Full Member
  • ***
  • Posts: 148
Re: Photon rigibody2dview for jumping and running?
« Reply #2 on: March 02, 2015, 09:18:39 AM »
Hi, thanks for replying.

I think I got it right at the moment, the addforce is really smooth. Now I'm having issue with gravity/physics?

When I set gravity to 0 its smooth, when its set to 1, while falling from a jump and during the jump its jerky?

I have have tried syncing gravity, but still no difference.
« Last Edit: March 02, 2015, 09:44:27 AM by rongconcrx »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon rigibody2dview for jumping and running?
« Reply #3 on: March 02, 2015, 02:07:41 PM »
Hi,

 I think you may try to do too much on the slave side.

 typicall, the slave should do very little, typically not even adding forces, instead only the owner add force and send its position and rotation for slaved instance to catch up with a smooth algorythm ( a simple vectorLerp for example). so I think you should try to cut down on the slaved work and see if it performs better.


 Bye,

 Jean