Вот скажем я выполняю в коде анимацию.
Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class PlayerController : NetworkBehaviour {
private Animator animator;
void Start()
{
animator = GetComponent<Animator>();
}
void Update()
{
animator.SetBool("move", false);
if (Input.GetKey(KeyCode.W))
{
animator.SetBool("move", true);
}
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class PlayerController : NetworkBehaviour {
private Animator animator;
void Start()
{
animator = GetComponent<Animator>();
}
void Update()
{
animator.SetBool("move", false);
if (Input.GetKey(KeyCode.W))
{
animator.SetBool("move", true);
}
на персонажа конечно добавил компонент NetworkAnimator и поставил галочки на свою анимацию. Но не не отображается анимацию у других.
читал разные доки и так искал, находил что надо вставить такой код
Синтаксис:
Используется csharp
public override void OnStartLocalPlayer()
{
NetworkAnimator netAnim = GetComponent<NetworkAnimator>();
netAnim.SetParameterAutoSend(0, true);
}
public override void PreStartClient()
{
NetworkAnimator netAnim = GetComponent<NetworkAnimator>();
netAnim.SetParameterAutoSend(0, true);
}
Я конечно пробовал вставлять эту часть кода в скрипт, но не помогло.