How would i go about using this block to create a bigger block used with the original block?
so it expands outwards basically
local newPart = script.Parent:Clone()
newPart.Parent = Workspace
newPart.Scale = --put here whatever you want the scale to be, maybe 2x of the original part
The newPart.Parent line might be unnecessary, as it is a clone of the original one, it would be in workspace already, so first try without it
No, it’s supposed to generate a perfect cube around the part using the already existant model. This just clones it and puts it in workspace which is not what i wan’t to achieve.
It is Generating a perfect cube around the part. Cloning that part means it is in the same position as the original part, and if you change the scale it will be bigger than the original part. IF you dont want the original part to stay there, you can destroy it, which i assumed was pretty obvious, if you know a little bit of scripting and are not trying to make a whole game just by asking every little thing on the forum
This pisses me off.
I need it to expand outwards, not just copy it and make it bigger since that is not what i want to achieve.
I need the mathematical formula of expanding a cube, if you can not give me something mathematical i will simply not respond.
Expanding the size will just make it bigger, i need to expand the cube using more cubes without overlapping them and putting them across a grid perfectly.
from the picture it looks like you’re trying to get the cube to grow. to grow the cube you need to use TweenService. TweenService is kind of a quirky subject, so i suggest reading up on how to use it or watch a youtube video.
here is a devforum post explaining tween service:
https://devforum.roblox.com/t/beginners-tween-service/1744218
hope this helps
I really hope you’re not serious.
If you read my other comments you would see that this is litteraly not what i need
pls read before type
just to clarify you want to basically make a border around that cube that is made from that same sized cube?
yes, like putting minecraft blocks around a block
It’s not very helpful putting “2D cube” as the title.
Well, could’ve read my post too. Where i stated that i wanted to generate cubes around it, and not jsut scale it up.
I really don’t understand what you mean by that. Perhaps you meant the cube expanding like this?
Kinda but it generates a square shaped cube (around it) and layers out
Okay, so do you want the cube to expand by cloning more parts or just increase the size of the cube
from what I can tell you’re looking for something like this
local function generateAround(part: BasePart)
local xOffset, yOffset = part.Size.X, part.Size.Z
for x = -1, 1 do
for y = -1, 1 do
if x == 0 and y == 0 then continue end
local newPart = part:Clone()
newPart.CFrame *= CFrame.new(x * xOffset, 0, y * yOffset)
newPart.Parent = part.Parent
end
end
end
generateAround(workspace.Part)
pro tip: better word your titles/questions and be nicer to people who try to help you..