Код из курса "Unity3DSchool Unity Базовый курс - 2D платформер с нуля":
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class groundPatrol : MonoBehaviour
{
public float speed = 1.5f;
public bool moveLeft = true;
public Transform groundDetect;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Translate(Vector2.left * speed * Time.deltaTime);
RaycastHit2D groundInfo = Physics2D.Raycast(groundDetect.position, Vector2.down, 1f);
if (groundInfo.colldier == false)
{
if (moveLeft == true)
{
transform.eulerAngles = new Vector3(0, 180, 0);
moveLeft = false;
}
else
{
transform.eulerAngles = new Vector3(0, 0, 0);
moveLeft = true;
}
}
}
}
Assets\scripts\groundPatrol.cs(23,24): error CS1061: 'RaycastHit2D' does not contain a definition for 'colldier' and no accessible extension method 'colldier' accepting a first argument of type 'RaycastHit2D' could be found (are you missing a using directive or an assembly reference?)