Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

var localScale: Vector3;
Vector3 localScale;
localScale as Vector3

Description

The scale of the transform relative to the parent.

	 // Widen the object by 0.1
	transform.localScale += Vector3(0.1,0,0);
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        transform.localScale += new Vector3(0.1F, 0, 0);
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		transform.localScale += Vector3(0.1F, 0, 0)