🎮

VR Multiplayer using Fusion 2 - Part 3

Jul 10, 2024

VR Multiplayer using Fusion 2 - Part 3

Introduction

  • Presenter: Raming
  • Content: VR multiplayer tutorial using Fusion 2
  • Topics covered: Creating UI, completing player spawner script, handling callbacks
  • Resources: Subscribe, Patreon for support, LinkedIn Profile

Scene Overview

  • Created a game area scene
  • Player spawner setup
  • Network Runner setup from previous tutorial
  • Ensured enable visibility for Network Runner
  • Reference assignment for players and room creation

Player Instantiation

  • Utilize callbacks: player join, player left, on input
  • Code Overview:
    • Get positions using Vector3
    • Use NetworkObject to instantiate player
    • Set player position and rotation
    • Utilize NetworkRunner.spawn method
    • Handle conditions for host and server using NetworkRunner.isServer

Handling Callbacks

  • Player Join: Assign positions and instantiate player
  • Player Left: Retrieve and despawn network objects, remove references
  • Host & Client Mode: Differentiate between hosting and joining

UI Creation

  • Created a basic UI using Canvas
  • Panel setup for host and join options
  • Script attached for mode selection
    • Modes: None, Host, Join
    • Setting game mode on player preferences
  • Methods for starting game as host or client

Networking Handling

  • Network region fixed to nearest region (e.g., Asia)
  • Host ensured to load correct scene
  • Debugging instantiation issues
    • Fixed condition checks for NetworkRunner initialization

Final Notes

  • Successful player instantiation
  • Next part will demonstrate VR integration and local player initialization
  • Reminder: Like, subscribe, and support on Patreon
  • Resources available for download post-series

Conclusion

  • Achievements: Basic setup for player instantiation, handling host-client differences, UI creation for network handling
  • Next Steps: VR integration, local player adjustments

End of Video Reminder:

  • Actions: Like, subscribe, support on Patreon
  • Resources: Download files provided after series completion
  • Contact: LinkedIn profile for further interaction