#SkBee Ray Traces are BROKEN

1 messages · Page 1 of 1 (latest)

dire galleon
#

I'm actually losing my mind over this, I've never had this kind of issue with rays and have NO idea why they hit before actually hitting something like I am genuinenly losing my marbles.

on elytra boost:
    if regions at player contain "koth":
        cancel event
    # Prevents 1.21.6> firework boosting whilst looking at a block
    set {_ray} to ray trace from player with max distance 4.5
    if hit location of {_ray} is set:
        line(player's eyes, hit location of {_ray}, ray trace hit block of {_ray})
    if ray trace hit block of {_ray} is set:
        cancel event

# DEBUG LINES
function line(origin: location, destination: location, hit: block):
    force draw 1 rgb(0,0,255) trail particle moving towards {_destination} over 30 seconds at {_destination}
    set {_vector} to vector from {_origin} to {_destination}
    set {_length} to vector length of {_vector}
    set {_loop} to {_length} / 0.1
    set vector length of {_vector} to 0.1
    loop {_loop} times:
        if {_hit} is set:
            force draw 1 rgb(255,0,0) trail particle moving towards {_origin} over 30 seconds at {_origin}
        else:
            force draw 1 rgb(0,255,0) trail particle moving towards {_origin} over 30 seconds at {_origin}
        set {_origin} to {_origin} ~ {_vector}```

-# NOTE: Ignore claude in the terminal, I was using it for another script, this code I am sharing is not AI
#

like why is it random

#

sometimes it hits the wall

#

sometimes it stops before hitting the wall

sturdy flame
#

Maybe try using the ‘on right click’ event instead of ‘on elytra boost’. It might be something with cancelling the event idk

humble coral
#

Try to see if it is

dire galleon
#

is there a way to ignore specific entities from the ray trace

humble coral
#

Is this supposed to prevent players from flying allong the wall?

dire galleon
#

because if I make a raytrace from location along a vector it hits the player if I use like player's eyes for example

humble coral
#

to confirm if its a certain type of entity

#

let me try to pull it up

dire galleon
#

which makes cobwebs in elytra pvp pointless as hell

humble coral
#

ohh that's what you want

humble coral
#

if you are going to do this

#

because sometimes it cancels altogether once it runs into the first entity

#

I had this issue with item drops

#

I had these lines

#

try something similar to that

#

Also with that

#

you should be able to use player's eyes

#

just set a variable to 4.5 blocks in front of player's eyes

#

and use the same cancelling logic if it runs into something early

#

Also looking at your video @dire galleon it could be specifically when you are flying straight into the wall

#

When I'm looking back at your video, so I think it is the player entity getting caught in it

#

Watch it back yourself, you'll notice it

#

I tested it tho, it seems to be working just fine on my end

humble coral
#

might be an easier solution if this is not working for you

dire galleon
humble coral
#

instead of any entity

#

then you should be fine

dire galleon
#

but there's

#

that's not an issue in the example I showed

humble coral
#

because it cast only as far as it hit something

dire galleon
#

I went far as hell in a few of the attempts

humble coral
#

the earlier ones that did hit, you weren't

dire galleon
#

why the fuck is that actually the issue, I just tested adding while ignoring entities
how the hell am I traveling 4 blocks in a tick or whatever

#

what

dire galleon
#

oh my god

#

it's the firework

#

the stupid firework entity

#

thank you

inner raftBOT
# dire galleon thank you

Consider increasing someone's reputation with </reputation increase:1458495875985969212> if you found them to be helpful!

humble coral
#

oh yeah I didnt consider that that was an entity in itself

#

but hey

inner raftBOT
#

You successfully increased @humble coral's reputation. They now have 2 skoints!

humble coral
#

at least entities was the issue overall

#

have a nice day mate

brisk blade
dire galleon
#

to fix that

#

on bruhhbox

#

where else

brisk blade
#

What was the issue.