Showing posts with label PUN. Show all posts
Showing posts with label PUN. Show all posts

Wednesday, 17 February 2016

PUN shooter #4 - More drama

In the last 4 sessions I added the following:

  • A game menu
  • UI elements to 'dramatise' the re-spawn process
  • Sound effects and music
  • A credits section.
Nothing too hard or complex here, even though getting all this done has been a long day's work.


You can try the game [here]

Saturday, 13 February 2016

Pun shooter #1 - Shooting

In the past couple of days I've been making a basic shooter. Caveats.

Transform sync doesn't work. Why?

  • If using a rigid body, ensure kinematic is on for the proxy (but you should still see some sync regardless.
  • Remember to add the NetworkTransformView to PhotonView.
Collisions not working

Kinematic proxies aren't good at generating collisions. Why? Because if you receive say, 10 positions per second, and an object bounces on the remote, the proxy may interpolate towards the new direction without picking up the actual collision.



I realised this while dealing with physical projectiles. This time around I decided to Network-Instantiate projectiles but adding physics locally via script attached to the bullet prefab.

Ghost bullets

What we create with PhotonNetwork.Instantiate(...) must be destroyed with PhotonNetwork.Destroy(...). A symptom of doing otherwise (for example, destroy all local copies of an object) is that entering clients will "replay" previously instantiated objects.

Input methods

After I put a little game together we got to try it on two laptops simultaneously. One of the laptops didn't respond to key strokes. Investigating, we found that a foreign input method was conflicting with game input.