So i need to create some hollow tubes/pipes that players can walk through. I tried using negates and unions, and it worked, although the players sometimes end up running into what seems like invisible walls. Anyone have a idea of how I can create this better?
use the archimedes plugin, it helps with this kind of thing.
Build the mesh in Blender.
I just tried making a pipe and did it in under 30 seconds lol.
If you don’t use Blender, there are a couple of plugins that help with hollowing. You can also find free mesh packs in the toolbox. Just make sure they don’t have any viruses!
You need to change the hitbox
Oh boy, this one’s fun and I might actually suck at explaining it.
You can correctly scale any block to be mathematically, since it’s possible to get the subsection of a circle’s circumference.
This equation is actually pretty simple:
(sections/360) * (d * pi)
- sections is the number of blocks in your tube
- d is the diameter
- pi is pi
Now its good and all having this knowledge, but we’re explaining how to make a tube. Not maths.
Insert a part, and make it as wide as you want to (on the X axis so the code doesn’t break). Remember how long this is, this is your diameter.
Place a part of size 1,1,1 at both ends of your line and delete the original part.
Now select your two parts, duplicate and rotate it 5* until you have a circle. (I’m doing 5 because it makes the math a bit easier)
You should now have a half finished tube. Now we just need to apply the maths.
Finally, select everything in the tube then run this code in the command bar.
local diameter = 10 -- replace this number with the length of your original line local s = game:GetService("Selection"):Get() local SUBSECTION = 360/#s local y = (SUBSECTION/360) * (diameter * math.pi) for _, v in ipairs(s) do v.Size = Vector3.new(1,y,1) end
i would like to add images but im on a phone
Put the collision box to
Wow, can’t believe it’s that simple. Thanks! I sure do wonder why roblox doesn’t just make that the default union collision…
It’s not the default because it’s typically bad for game performance if used too much in a game.
Also Unions and Meshes aren’t really great for accurate collisions even with that setting, and typically I’d use Parts for anything I know the player will certainly be colliding with.