generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Why is the size not what I tell it to be?

Previous Thread :: Next Thread 
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
11 Mar 2014 04:22 PM
I'm making a block generator thing, and each part is not the size I want it to be. When I create a new part, I give this size:

p.Size = Vector3.new(5, 5, 5)

but it comes out to

5, 4.8, 5

I've tried all the form factors and this is still happening.... What am I doing wrong?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
11 Mar 2014 04:23 PM
It's form factor needs to be custom.

p.FormFactor = Enum.FormFactor.Custom

something like that

#nerdsunited
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
11 Mar 2014 04:36 PM
It's still coming out to a Y size of 4.8
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
11 Mar 2014 04:36 PM
Here is the script if it will help:

local length, width, height = 10, 10, 10

local brick = {}

--Properties
brick.delayTime = 0.03
brick.Name = "Brick"
brick.Size = {5, 5, 5}
brick.Color = BrickColor.new("Black")
brick.Anchored = true
brick.FormFactor = Enum.FormFactor.Custom

for l = 1, length do
for w = 1, width do
for h = 1, height do
wait(brick.delayTime)
local p = Instance.new("Part", Workspace)
p.Name = brick.Name
p.Anchored = brick.Anchored
p.BrickColor = brick.Color
p.Size = Vector3.new(brick.Size[1], brick.Size[2], brick.Size[3])
p.Position = Vector3.new(l * brick.Size[1], h * brick.Size[2], w * brick.Size[3])
p.FormFactor = brick.FormFactor
end
end
end
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
11 Mar 2014 04:38 PM
you need to set the form factor before you set the size.

#nerdsunited
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
11 Mar 2014 04:39 PM
Oh, now I feel stupid..

Thanks, :D
Report Abuse
dpark19285 is not online. dpark19285
Joined: 14 May 2013
Total Posts: 25
11 Mar 2014 04:50 PM
The Form Factor can also be changed using numbers:
p.FormFactor = Enum['2']

Something like that. I'm pretty sure what I've written just now is wrong though. I'm just saying there's another way, not that it's more efficient or anything.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
11 Mar 2014 04:54 PM
You can use a string to do it too.

p.FormFactor = "Custom"
Report Abuse
dpark19285 is not online. dpark19285
Joined: 14 May 2013
Total Posts: 25
11 Mar 2014 04:57 PM
Pretty sure that's the least time consuming and better than all of us...

O)_O)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image