@fire7side
So my attempt to adding the directions to the ray_directions array is based on what you've got and what he's got. Here is what it looks like:
func raycast_generator():
ray_direction.resize(ray_num)
var vec = Vector3.RIGHT
for index in ray_num:
var ray = RayCast.new()
ray.cast_to.z = -20
ray.rotation.y = deg2rad(360/ray_num) * index
ray.enabled = true
add_child(ray)
ray_direction[index] = vec.rotated(Vector3.UP,deg2rad(360/ray_num) * index)
print(ray_direction[index])
I've managed to get rid of the ray_count variable as it was taking up unnecessary space. However, some sort of ray_num variable has returned for convinence. Here is what was printed in the the output:
(1, 0, 0)
(0.707107, 0, -0.707107)
(-0, 0, -1)
(-0.707107, 0, -0.707107)
(-1, 0, 0)
(-0.707107, 0, 0.707107)
(0, 0, 1)
(0.707107, 0, 0.707107)
It looks like I did get vectors into the array but, I'm not completely sure if it's the correct location. What do you think?