#lightweight way to find POI's?

1 messages · Page 1 of 1 (latest)

languid moth
#

I'm making a grappling hook and I previously had made it so a raycast is made from the player's view direction but I found that it was hard to aim and inaccurate a decent amount of the time.

here's my idea for how to make it a little more intuitive, the player will make a raycast from their head to every grapple point. as long as the ray is unobstructed it is a valid POI it is valid. the grappling gun will shoot at the POI with the most similar direction or rotation to the players view and use that for the grapple.

the problem is that I don't know of a lightweight way to check within 18 block radius of the player for these blocks without it getting really laggy trying to check every block every tick.

I was thinking about making a 2d array of raycasts from the players view but thought it could be inaccurate and laggy moreso than this new method.

#

red is POI
blue is player
blue line is player view direction
green line is the chosen poi
yellow is the raycasts from the block

wet sparrow
#

@proven needle you have that type of script right?

languid moth
#

I've used a similar script for getting enemies with FOV in a lightweight way, just don't know how to do it for blocks without blowing up my computer

proven needle
wet sparrow
#

like the get entiesi in the view

proven needle
proven needle