How would I check if two Vector3 values intersect with each other? Note: I will not use raycasting since it is a vector and not a part, so don’t get confused.
I haven’t tried doing anything yet because I knew I was going to fail every time. I also didn’t find anything that suited my needs on the Roblox Developer Forum.
while wait() do
if workspace.Part.Position == workspace.Part2.Position then
print("Instersected")
end
end
or
while wait() do
local magnitude = (workspace.Part.Position - workspace.Part2.Position).Magnitude
if magnitude <= 1 then -- Instead of 1, put whatever number you want
print("Instersected")
end
end
EDIT
I have tried the answer given down below and it doesn’t work, when I run the code it doesn’t print anything, I don’t know why.
I recommend using a BoundingBox and then get a list of descendants, then check each descendant to see if it is a part and if it is a part then check the BoundingBox.
Also, please use code tags.
I recommend trying something like this –[[
When you run this code, if everything goes correctly, it should print
“Intersected”
]]