Я следовал этому учебному коду YouTube до 11:55 в нем и сделал точно все, но я получаю две ошибки:
Название "Переместить" не существует в текущем контексте, а метод должен иметь тип возвращаемого значения.
Это код для смешанного дерева для перемещения персонажа с анимацией:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
private Animator _animator;
// Start is called before the first frame update
void Start()
{
_animator = GetComponent<Animator>();
}
// Update is called once per frame
void Update()
{
if (_animator == null) return;
var x = Input.GetAxis("Horizontal");
var y = Input.GetAxis("Vertical");
Move(x, y);
}
private Move(float x, float y)
{
_animator.SetFloat("VelX", x);
_animator.SetFloat("VelY", y);
}
}