using System.Collections.Generic;
using UnityEngine;
public class DinoYonDuzeltme : MonoBehaviour
{
public LayerMask katman;
public DinoHareket hareket;
public Transform dino;
void Start()
{
hareket = GetComponent<DinoHareket>();
dino = transform.parent;
}
void Update()
{
RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, 0.1f, katman);
if(hit.collider == null)
{
dino.localScale = new Vector3(dino.localScale.x * -1, dino.localScale.y, dino.localScale.z);
hareket.hiz *= -1f;
}
}
}
so this is the code and I get a error called this if you know please help me, Im trying to make a enemy mob turn around