Author Topic: Syncing partial positions  (Read 2378 times)

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Syncing partial positions
« on: April 29, 2013, 11:21:46 PM »
Hey,
I was hoping there was a way to only sync x and z position. I have these floating spheres and cubes that bob to look like they are hovering. But sending that data over the internet is useless as they really only move on a 2d plane (there is no hills or jumping) and would need to be updated every frame to look good. The server doesn't need to compute the hover or the spinning because there is no facing direction. It is a very simple game. If this can be done with a function beautiful otherwise I'll have to find a way to make the computer ignore the received y coordinate.

Kind regards,

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Syncing partial positions
« Reply #1 on: April 29, 2013, 11:50:12 PM »
  1. tno.Send("MySync", Target.Others, transform.position.x, transform.position.z);
  2.  
  3. [RFC] void MySync (float x, float z) { transform.position = new Vector3(x, 0f, z); }

Scobbo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Syncing partial positions
« Reply #2 on: April 29, 2013, 11:52:33 PM »
Ah brilliant! Thanks so much!