При запуске скрипта строка Debug.Log("Raydrawn") работает, но луч не рисуется. Я уже пробовал менять цвет, расстояние и положение как объекта, так и луча. Это не показывает. Есть идеи?
Код: Выделить всё
using JetBrains.Annotations;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AttackCheck : MonoBehaviour
{
public bool hitting = false;
Rigidbody2D rb;
void Start()
{
hitting = false;
rb = GetComponent();
}
void FixedUpdate()
{
RaycastHit2D hit = Physics2D.Raycast(transform.position, transform.forward, 1000f);
Debug.Log("Ray drawn");
Debug.DrawRay(transform.position, transform.forward, Color.blue, 50f);
}
}
Источник: https://stackoverflow.com/questions/781 ... -being-run