#raycasting

1 messages · Page 1 of 1 (latest)

latent gate
#

so im trying to make damage to all the entities in my view and i want it to make it from 1 - 20 blocks but i cant cuz i need to put to many commands so is there a single command i can use to make this?

static fulcrum
#

Define "in your view", this is NOT a fixed volume as we can adjust the field of view setting and one could argue that blocks obstruct your line of vision and thus your "view".

latent gate
#

yo bro i dont undrtsand

static fulcrum
#

You have a FOV setting that changes what you see

latent gate
#

yeh i know

static fulcrum
#

Most people don't touch it but some people play with it set to quake pro, this setting changes the volume/area you have to check

latent gate
#

but

static fulcrum
#

Same with walls or pillars that can block your view, does this matter yes/no

latent gate
#

what im trying to say is that i want a command or smth to damage the mobs im looking in a range of 20 blocks

static fulcrum
#

There is no direct way to detect what the player can see

#

What you want requires you to define what you want more specific

#

Unless you only care about directly in front of the player

latent gate
#

well atleast mae damag to every entity in the direction im looking

#

sry my keyboard is break

latent gate
static fulcrum
#

Directly in front would be done with a raycast

latent gate
#

and how do i do that

fluid lotusBOT
latent gate
#

i make this but as you can see is bad

static fulcrum
#

Above guide works with a recursive function

#

Which is definitely more efficient, in the end it will boil down to do the same as what your just shared.

#

But you can adjust the range and step size (often we take a step size smaller than a full block)

latent gate
#

i didnt understand but ok

solemn pebble
#

its a function that loops itself and changes itself to run the commands you wrote, but at intervals of 0.1, it writes itself, but not in the code so you only have to write like 4 lines