Well this line of code begun anoying me, and i have no idea how to fix it
What do you want to achieve?
Well trying to remove this bug lol
What is the issue?
Well i tryed useing the Shperecast function and well it’s compleatly unsucsesfull
What solutions have you tried so far?
Tryed to find any soliutions on google but no results and then tryed on the discord, well no result there ;-;
The Code (if you want more i can send full script, but it’s 85 lines of code and it’s painfull to watch) the error is on Local castdown = …
for _, i in pairs(theradius:GetChildren()) do
local castdown = workspace:Spherecast(Vector3.new(i.Position.X, i.Position.Y, i.Position.Z), Vector3.new(i.Position.X, i.Position.Y, i.Position.Z), Vector3.new(i.Position.x, i.Position.Y - 10, i.Position.Z))
if castdown == nil then
i.Name = "Totaly Empty"
i.BrickColor = BrickColor.Red()
end
There’s a typo in your code, instead of x it should be X.
Also as the above reply mentions the second parameter of Spherecast is a number/float that describes the radius of the sphere of the cast, not a vector. If you’re trying to cast from the positional vector all the way to the second vector in a sphere-like way then you can calculate the radius with this equation:
local offset = 0 --in case you want the radius to be a bit larger
local radius = (v1-v2).Magnitude+offset --where v1 and v2 your 2 vectors