Hi! Here is my code http://p.tuduf.ru/UOtRtRc
If the enemy gets into the raycast, then it is clearly painted green, and with the cube otherwise, if I point the cursor at the enemy, it turns blue without entering the gizmo
public static Vector2 GetDirectionTowardsCursor(Transform baseTransform) {
var mouseWorld = Camera.main.ScreenToWorldPoint(Input.mousePosition);
return new Vector2(mouseWorld.x, mouseWorld.y) -
new Vector2(baseTransform.position.x, baseTransform.position.y);
}
public static Transform GetCharacterTransform()
{
return GetCharacter.transform;
}