PurrNet
  • 🐈Introduction
    • ‼️Unique to PurrNet
    • 💲Pricing
    • 💻Compatibility
    • 📚Addon library
    • 🗺️Roadmap
    • 🏎️Performance
      • RPC Benchmarks
      • Network Transform benchmarks
    • 🥰Support PurrNet
  • 🏁Getting Started
    • Installation
    • Minimal Setup
    • Converting to PurrNet
      • Converting from Mirror
      • Converting from FishNet
  • 📚Simple Guides
    • Easy Multiplayer Physics (input Sync)
  • 🖥️Systems and modules
    • Network Manager
      • Network Rules
      • Network Prefabs
      • Network Visibility
        • Distance condition
      • Authentication
    • Transports
      • Composite Transport
      • UDP Transport
      • Web Transport
      • Local Transport
      • Steam Transport
      • Purr Transport
      • Simulating latency
    • Network Identity
      • Ownership
      • Spawning & Despawning
      • NetworkBehaviour
      • Don't destroy on load
    • Network Modules
      • Common Pitfalls
      • Sync Types
        • SyncVar
        • SyncList
        • SyncArray
        • SyncQueue
        • SyncDictionary
        • SyncEvent
        • SyncHashset
        • SyncTimer
        • SyncInput
    • Remote Procedure Calls
      • Generic RPC
      • Static RPC
      • Awaitable RPC
      • Direct Local Execution of RPCs
    • Broadcasts
    • Scene Management
    • Client Side Prediction
      • Overview
      • Predicted Identities
      • Predicted Hierarchy
      • Best Practices
      • Input Handling
      • State Handling
    • Instance Handler
    • Collider Rollback
    • BitPacker
      • Networking custom classes, structs & types
  • Plug n' play components
    • Network Transform
    • Network Animator
    • Network Ownership Toggle
    • Network Reflection
    • Network State Machine
  • 🎮Full game guides
    • 🔫First Person Shooter
    • 🪓Survival Game
  • ✊Community Guides
    • Chat system with broadcasts
  • 🧩Addons
    • Lobby System
  • 🤓Terminology
    • Early Access
    • Channels
    • Client Auth/Everyone (Unsafe)
    • Host
    • Server Auth (Safe)
    • PlayerID
  • 💡Integrations
    • Dissonance
    • Cozy Weather
Powered by GitBook
On this page
  1. Plug n' play components

Network Animator

PreviousNetwork TransformNextNetwork Ownership Toggle

Last updated 5 months ago

This allows you to automatically network any parameter value within the Animator. This component needs to be on the same object as an Animator, otherwise it won't work.

It will expose the values within the animator, of which you can toggle on and off in order to choose which to sync and which not to sync.

Beware: This does not automatically sync "triggers". A trigger would have to be called through the NetworkAnimator component, similar to how it is called on a regular animator.

This is how you'd call a trigger:

private NetworkAnimator _netAnimator;

private void DoPunch() {
    _netAnimator.SetTrigger("Punch");
}

The Network Animator also allows for you to control the animations directly through the Network Animator, so you don't need a reference to both the normal Animator as well as the Network Animator. So you can easily handle parameters as well:

private NetworkAnimator _netAnimator;
private RigidBody _playerRigidbody;

private void DoPunch() {
    _netAnimator.SetFloat("Speed", _playerRigidbody.Velocity.magnitude);
    _netAnimator.SetBool("IsMoving", _playerRigidbody.Velocity.magnitude > 0.1f);
    //This can be done for all actions of the Animator. Above is just two examples.
}