Change the size of a Raycast

Godot Version

Godot 4

Question

can i change the size of a raycast as it goes out? example: when it’s 1 unit away from player its at size 1 but when its at 4 units away its at size 4. I’m trying to make a superliminal camera.

The ray cast is a ray, so it has no width, you are probably looking for some variation of shape cast, but this isn’t possible with ray cast itself

can i change the size of a shape cast as it goes out?

You would need a shape like that manually, it takes a shape you configure

so if i had an area 3d as a child, could i change the size every time the raycast expands?

That could be something to test as well

what if i made my own diy raycast, would there be a way to do:

position = player.position
while !get_touching_body():
    move_towards_target_point(targetpoint)
    scale += 1
    if get_touching_body():
        print(distance_to_player)
        stop_script()

mainly i would need a get_touching_body() function

It’s a bit hard to read your code when it’s not formatted properly, can you put it between triple backtics to format it? ``` like these

I can’t help you there I’m afraid, I’d suggest testing shape casting or using multiple rays

i found get_colliding_bodies(). havent tested it, but maybe itll work