Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you check if there's enough room to spawn/or force spawn a brick?

I'm spawning a brick/model in but if there happens to be something in the way of the spawn coordinates (using vector3) its will just spawn higher and higher until its out of the way of the obstruction. Is there a way to either:

  1. Check the spawn zone via script? or...

  2. Use a different method of spawning that will force the spawn whether another brick is clipping inside it or not.

1 answer

✓ Accepted answer

Both options are plausible, and neither is even that difficult! We'll go with option 2 for now, since it's more common and even easier to use.

This method is CFrame. CFrame, or CoordinateFrame, will allow a Part to clip other objects. Another difference between this and Vector3 is that CFrame contains rotation, but you won't be using that in this situation.

There are many different CFrame constructors we can use to put together different combinations of position and rotation. For our purposes, two could suffice. Take a look;

workspace.Part.CFrame = CFrame.new(0, 0, 0)

--Or

workspace.Part.CFrame = CFrame.new( Vector3.new(0, 0, 0) )

Both of these will position the part to 0, 0, 0, but it will clip other objects.

1 comment

0

This worked great. Especially the second example you gave with the vector3 thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.