IntersectOperation in roblox studio seems to be bugged, when it comes to adding textures to it.
In a brand new baseplate project, i try to run the following code in ServerScriptService:
local hit = workspace.a
local partb = workspace.b
local test1 = partb:IntersectAsync({hit})
test1.Parent = workspace
local height = 0.25
local width = 0.25
local bulletdecal = Instance.new("Texture")
bulletdecal.Parent = test1
bulletdecal.Texture = "rbxassetid://131037006801186"
bulletdecal.OffsetStudsU = width/2
bulletdecal.OffsetStudsV = height/2
bulletdecal.StudsPerTileU = width
bulletdecal.StudsPerTileV = height
bulletdecal.Face = "Front"
As seen in the image below, workspace.a = the small cube and workspace.b = the big cube
When i run this script, the following happens:
(The face is highlighted, the video below showcases the distorted decal)
The decal is distorted on the wrong face. (For those wondering i maunally deleted part a and b, this does not effect the result)
Expected behavior
What i would like to happen is that the decal not to be distorted and work properly, as seen in the following video:
INPUTS NOT SHOWN IN VIDEO:
00.12 - Copy
00.10 - Paste Into (pasted the texture that i copied into the intersection)
When i manually create an intersection, the decal is placed correctly (after i copy it from the other intersection)
Something to note:
In the code, if i swap the hit and partb, the relative face is not correct.
This is not limited to just blocks, this problem is constant throught all of the different types of parts (Ball, Wedge, Cylinder)
I have tried multiple different strategies, none have worked.
A private message is associated with this bug report