#find free way

1 messages · Page 1 of 1 (latest)

cunning warren
#

hello, so i want enemies in my server to shoot projectiles at the player, but they should only be shot if the enemy has a free line of sight to the player.

Does anyone know if theres an optimized way / an expression to check if the line of sight is free?
checking every entity, looping the distance between it to the player, and checking if the block is not air seems like a very unoptimized way to do it.
Any idea/help would be appreciated

#

never mind, thx anyways yall