PhysicsUtils

erre
erre
Hi,

We are converting a 2d arcade physics based game to Photon True Sync.

One possible action in our game is to kick a ball or a player near you. When a player press the button we currently do:

Collider2D[] colliders = Physics2D.OVerlapCircleAll ( radius );

and then we apply a force to all rigidbody in that vector.

How can we do this with TrueSync? My idea is to do the same thing, and then get the TSTransform of object and check that distance is really less than radius.

But this means that my objects should have two colliders (Collider2D for Unity Physics and Collider2D for TrueSync Collision).

Is this right?

Thank you.
Andrea.

Comments

  • Hey @erre, you should avoid use Unity components for callback like you mentioned above, because the game needs to be deterministic in every client and those Unity callbacks can happen in different frames for the players involved. The release 1.0.6 of TrueSync will include a TSPhysics2D (which contains an "OverlapCircleAll" method as well).
  • Thanks @JeffersonHenrique for support!