I have a problem. I have an model, every part in this model is non-canCollide so the parts shouldn’t collide with other parts, but however when a model (with every part non-canCollide) touchs another model (also with every part non-canCollide), the model jumps on the other model
Here is a video:
I have tried setting the mouse target filter on the parent of the models but still nothing
when i set the primary part cframe with a script it doesn’t happen
i’m pretty sure it can’t
it happens with other models/parts
--snap to grid
function snapToGrid(position)
return Vector3.new(
math.floor(position.X/1+0.5)*1,
position.Y,
math.floor(position.Z/1+0.5)*1
)
end
--when mouse moves, the event is fired
function onMouseMove(plr,ray,object,objectHeight,arrow,objectsFolder,plot)
local ignore = {object,plr.Character}
local part,position = workspace:FindPartOnRayWithIgnoreList(ray,ignore,false,true)
if part and (not objectPlaced and placing) and (object and (object:FindFirstChild("PLACING") and not object:FindFirstChild("ROTATING"))) then
if (part==plot or part:IsDescendantOf(plot)) or part:IsDescendantOf(objectsFolder) then
local newPosition = snapToGrid(position)
object:MoveTo(newPosition)
arrow:SetPrimaryPartCFrame(object:GetPrimaryPartCFrame() + ((object:GetPrimaryPartCFrame().LookVector * 3) + Vector3.new(0,objectHeight,0)))
arrow:SetPrimaryPartCFrame(arrow:GetPrimaryPartCFrame() * CFrame.fromEulerAnglesXYZ(math.rad(90),0,math.rad(-90)))
canPlaceObject = true
else
canPlaceObject = false
end
else
return false
end
end
also, when the mouse moves it creates a ray 100 studs above the mouse.Hit.p with direction Vector3.new(0,-1000,0) so just straight to the ground, just because i can’t set multiple target filters for mouse
plr - player
ray
object - the model
objectHeight - model extents size Y (object:GetExtentsSize().Y)
arrow - just an arrow that shows you what direction is the model facing, as in the video above
objectsFolder - folder where are the objects are stored