|
| 03 Apr 2012 03:45 PM |
| I've seen scripts that "shrink" a gun model, but I don't really understand the logic behind it. Could someone help me out? Because I would like to make a tool/script that scales models on a certain axis (x,y, or z, instead of all three at the same time) |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2012 03:50 PM |
| Most of the re-sizing models just find a point, preferably 0,0,0, and then make each piece scale by the amount, for example, if it's a 12x15x18 brick at 6,3,9 and you wanted to get it a third of its size, you would make the brick 4x5x6, and the position would be 2,1,3. |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2012 03:51 PM |
Try something like this (not this however)
xscale=1 yscale=1 zscale=1 model = workspace.Model:GetChildren() for i=1, #model do if model[i].className == "Part" then model[i].Size=model[i].Size+Vector3.new(model[i].Size.x*xscale,model[i].Size.y*yscale, model[i].Size.z*zscale) end end |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2012 03:52 PM |
| That's pretty much it, but you have to change the positioning of it or else your model will have a bunch of gaps. |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2012 03:54 PM |
| Yeah the re-sizing I understand, it's the re-positioning that confuses me |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Apr 2012 04:04 PM |
| I'm pretty sure it's not the same method |
|
|
| Report Abuse |
|
|
|
| 03 Apr 2012 05:10 PM |
Anybody? How do I do this? Not all parts will move the same amount... Will picking any origin vector position suffice or does it have to be exact center of model? |
|
|
| Report Abuse |
|
|