I get the error Unable to cast double to Vector3 in line 6:
function dig(controller)
local rayResult = workspace:Raycast(rayController.Position, rayController.CFrame.LookVector * 20, rayParams)
print(rayResult.Position)
if rayResult then
game.Workspace.Terrain:FillBlock(CFrame.new(Vector3.new(rayResult.Position.X, rayResult.Position.Y, rayResult.Position.Z)), 6, Enum.Material.Air)
print("Filled")
end
end
I have no idea how to fix it, even after looking trough many posts on the devforum.
why did you put Vector3.new in CFrame.new
if i remember correctly CFrame.new convert normal vector3 value (and number) into CFrame so you dont need to put Vector3.new in CFrame.new
This is the parameters of :FillBlock()
Terrain:FillBlock(CFrame,Vector3,Material)
This is the parameters that you put in:
Terrain:FillBlock(CFrame,double,Material)
pretty sure it just takes it as a position value, there isn’t really a difference at all, I just didn’t change it because it’s not relevant to the issue
that’s because it’s a radius, spheres generally only need a radius/diameter and a position to be made, however when you use FillBlock it could be a “Rectangular Prism” not just a “Cube” which means it requires a height, length, and width.