те кто знает язык C++ найдите ошибку в коде. using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Chacter : MonoBehaviour
{
public int lives = 3;
public float speed = 4.0f;
public float jumpforce = 1.0f;
public Rigidbody2D PlayerRigidbody;
public Animator charAnimator;
public SpriteRenderer sprite;
bool OnGround;
private void Awake()
{
PlayerRigidbody = GetComponentInChildren();
charAnimator = GetComponentInChildren();
sprite = GetComponentInChildren();
}
void Start()
{
}
void Move()
{
Vector3 tempvector = Vector3.right * Input.GetAxis("Horizontal");
transform.position = Vector3.MoveTowards(transform.position, transform.position + tempvector, speed * Time.deltaTime);
if (tempvector.x 1;
Debug.Log(colliders.Length);
}
private void FixedUpdate()
{
CheckGround();
}
void Update()
{
if (Input.GetButton("Horizontal"))
{
Move();
}
if (OnGround && Input.GetButton("Jump"))
{
jump();
}
}
}