It might be that the model that’s already there or the hitbox of the placed item are just a hair larger than the size you are checking for.
Try making your hitbox slightly smaller than the grid you are checking on. Say you have a 2x5x10 model, make the hitbox 1.99, 4.99, 9.99 instead so it doesn’t register something thats .02 studs overlap.
My viewmodel doesn’t have a hit box
Even if Parts are .0001 (yes, Roblox does recognize less than .001 studs) overlapped you are going to have issues.
I just used the term hitbox to describe your viewmodel.
Did you try my suggestion? You may want to try 1 Transparent CanCollide false Part as your ‘hitbox’ so that any tiny little Parts sticking out from the model don’t cross into the other model.
idk but try adding a loop so it always checks for anything overlapping??
it does have a loop, its going through a RunService.RenderStepped loop
Roblox treats parts that are simply touching surfaces, as in bounds. Even if they are not colliding together, they are touching.
If the part is in mid-air, touching absolutely nothing, then that would be classified as not in bounds.
How to fix it? I’m not entirely sure, but I would definitely not recommend making parts levitate a micro metre up, left or right, just to make them not touch.
I know what’s wrong, I just don’t know how to fix it.
It’s okay to make mistakes. Just check for possible solutions next time.
I found out it wasn’t that, it still doesnt work
I already know why it’s happening, it’s a common problem with physics related properties.
why is it happening??? pls tell me
Scroll up.
It’s because the surfaces are touching, not really because it’s going inside another part. Roblox thinks it’s still in-bounds.
so how can I fix this and change it to when a part is inside of another part not touching surfaces?
You can try a magnitude check, but it can only be circular, not squared.
Here’s how a magnitude check works:
local part = workspace.Part
local distance = 10
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
while task.wait(0.1) do
if (character.HumanoidRootPart.Position-part.Position).Magnitude <= distance then
print("in radius")
end
end
end)
end)
I tried moving the attachments where the viewmodel snaps a bit further away and it worked, but now theres a gap
Are you able to make the gap very small, like 0.001 studs?
k, ill try this now and let u know if it works
i changed my move to 0.01 and it still did this
i did it very small, still a gap…
Even with 0.001 studs? It’s barely noticeable.
yep, still a gap… lemme try even smaller