Pictured below is an image of 2 adornments acting as range indicators. The player MUST know that the RED area is a BLIND SPOT for the tower, and the BLUE area is a CLEAR RANGE for the tower to fire IF it sees an enemy there.
I know exactly how to make the underlying (serversided) system - raycast the targets that the tower is trying to hit. Filter out those whose raycasts return with ANYTHING, then work with the remaining table. However, I’m not certain how I’d visualize this and present it to the player in this concise manner. Spamming raycasts will likely lead to lag, but I can’t think of any other option.
tbh what would make me be able to know red is a blind spot would be to make the red spot invisible so that theres like three-fourths of a circle which anyone with a can figure out that’s where the tower can attack.
sorry if i didnt answer your question correctly i assumed the part where the player needs to know the red spot is a blind spot for the tower was a question
The red spot isn’t static. I’m asking how I can get adornments to display where the tower cannot fire beyond. For instance, a brick wall is an obvious line of sight blocker - I want to know the math behind getting the angle for that to display to the player, similar to BTD6 LOS blockers.
I took a look at that and used some code from there, however, I find myself in a predicament - the range is displaying vertically and the final wedge is not appearing. I modified SOME of the code, but nothing too concrete was altered.
I also must ask - is raycasting each part really the only solution? That sounds a bit process intensive, especially for something as user-dependent as the client’s machine.
Edit: Just modified how the iteration is done and added a small check for when the vertex being accessed is out of range. That fixes the missing piece issue, but I’m still hung up on the vertical range.