tin_nim
(Nuclear_silencer)
March 12, 2023, 2:41pm
#1
You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Placement system
What is the issue? It doesn’t detect the collision box, a non collideable and non touchable box that defines the premise of an object
What solutions have you tried so far? Debug it by creating a part to represent the hitbox, And the hitboxes seemed to intersect and be right
Video:Desktop 2023.03.12 - 21.35.07.05
SCRIPT:
local function checkIntersect(obj1,fold)
local overlap = OverlapParams.new()
overlap.FilterDescendantsInstances = {fold}
print(fold:GetChildren())
overlap.FilterType = Enum.RaycastFilterType.Whitelist
print(fold)
local objs = workspace:GetPartBoundsInBox(obj1.Box.CFrame,obj1.Box.Size+Vector3.new(0.5,0.5,0.5),overlap)
local p = Instance.new("Part")
p.Anchored = true
p.CFrame = obj1.Box.CFrame
p.Size = obj1.Box.Size+Vector3.new(0.5,0.5,0.5)
p.Parent = workspace
p.CanCollide = false
p.CanQuery = false
p.CanTouch = false
if #objs > 1 then return true end
return false
end
1 Like
Cronoaix
(Crono)
March 12, 2023, 3:09pm
#3
I believe this is caused by p.CanQuery
being set to false. Also, make sure the part is a descendant of the “fold” object because the Enum.RaycastFilterType
is set to Whitelist
.
I also would not recommend using Regions, it is more complicated and plus all Region3 functions are deprecated.
tin_nim
(Nuclear_silencer)
March 12, 2023, 3:29pm
#4
It is set to true and the type is whitelist, But i still dont understand why this would not work
Cronoaix
(Crono)
March 12, 2023, 4:47pm
#5
Odd, so the part you are trying to detect has CanQuery
set to true? In the code snippet, you listed above it is set as false p.CanQuery = false
Here is what CanQuery does CanQuery Collision Property
tin_nim
(Nuclear_silencer)
March 13, 2023, 2:09pm
#6
No The canquery fasle is not the detection part, Its just the visualization that is provided in the video as the box that getpartinbound represents
It could be because of this line:
if #objs > 1 then return true end
What this line does is only return true if there’s more than 1, not if there’s 1 or more.
tin_nim
(Nuclear_silencer)
March 14, 2023, 10:39am
#8
Wow never thought that would be a problem!
system
(system)
Closed
March 28, 2023, 10:39am
#9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.