Scaling R15 Models with NumberValue objects – script vs. manual

So I’m pretty good at scripting and pretty lousy at working with models. I tried to get around dealing with sizing my monster characters by doing it through script instead of manipulating the models. Spoiler alert: BIG MISTAKE.

Basically I did this with script:

  1. Created a bunch of monster spawner locations
  2. Picked an enemy from an enemy type list I’d set up
  3. Cloned the chosen enemy model into the workspace
  4. Moved it to the position of the spawner

This was fine for my standard sized zombie model.

It was NOT fine for my giant zombie model.  I first tried to scale it using code by

  1. Cloning the regular sized Zombie model via script
  2. Using script to create scale NumberValue Objects in the monster’s Humanoid (see wiki) and setting them:
    1. BodyDepthScale = 5
    2. BodyHeightScale = 5
    3. BodyWidthScale = 5
    4. HeadScale = 5
  3. Then cloned them off.

Here’s what happened:

Head in torso!

Legs merged!

The Solution (so far)

Well.. I haven’t found a way to do this through script. However, I did have success doing it manually:

  1. In Studio (not script), I copied the Zombie model
  2. I created the four variables above in the Giant Zombie humanoid:
  3. When I did that, the pieces of the zombie got all out of alignment, which gives some clues as to why when you do it with script you get a jumbled mess. So, I manually put the Zombie back together again, lining up the head, torso, arms etc.

Better!

I’d love to be able to do this with scripting, and can probably write something to place the parts back where they belong, but for now this will allow me to have giants roaming around without me going absolutely bonkers.

 

Leave a Reply

Your email address will not be published. Required fields are marked *