Ok, so;
I made a script that is supposed to fire a ray from the middle of a part to all surfaces in each frame and check if there is something else than the part itself. (like a type of roughly collision detection which knows the direction where the collision is coming from and how deep it reaches)
The script:
local function POS_UPADTE()
if mouse.Target then
count = count + 1
part.CFrame = mouse.Hit
direction = {
Vector3.new(0,part.Size.Y/2,0);
Vector3.new(-part.Size.X/2,0,0);
Vector3.new(part.Size.X/2,0,0);
Vector3.new(0,0,-part.Size.Z/2);
Vector3.new(0,0,part.Size.Z/2);
Vector3.new(0,-part.Size.Y/2,0)
}
for _, dir in ipairs(direction) do
local result = workspace:Raycast(part.CFrame.p,dir, param)
if result then
print(dir)
end
end
end
end
local function BUTTON_ONE(actionName, inputState, inputObject)
if icon == true then
if inputState == Enum.UserInputState.Begin and filter == false then
filter = true
mouse.Icon = "rbxassetid://6188843788"
mouse.TargetFilter = part
param = RaycastParams.new()
param.FilterDescendantsInstances = {part}
param.FilterType = Enum.RaycastFilterType.Blacklist
RS:BindToRenderStep("Position_Update",1,POS_UPADTE)
-- some more script but i think it doesn't matters
this script is btw an attempt to solve my other problem, read it to understand a bit more >click<
the issue with that is, that it’s like not return any result, only on the -Y ray sometimes it works too at other things but it’s hard to explain with words so here the videos:
I hope you somehow know the root of this issue.
Or know an alternate solution to the problem why I wrote this script >click< ^^
If you need more information, feel free to ask