Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity set object scale

//gets the local scale of an object
vector3 local = transform.localScale;

//sets the local scale of an object
transform.localScale = new Vector3(scaleX,scaleY,scaleZ);

//gets the world scale of the object but is read only
vector3 world = transform.lossyScale;
Comment

change scale of an object unity

    public GameObject cube;
    public Vector3 sizeChange; // This has to be set for (x,y,z) in the editor
    //public float cubeSize = 0.2f;

    void OnMouseDown()
    {
        cube.transform.localScale = cube.transform.localScale - sizeChange;    
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# how to load type of class from string 
Csharp :: shell32.dll c# example 
Csharp :: Destroy(GameObject.Find("Turret_Laser_Hit"), 0.2f); 
Csharp :: Modify middleware response c# .net 
Csharp :: c# .net core 3.0 trying Exception The transaction log for database is full due to ACTIVE_TRANSACTION 
Csharp :: c# order by descending on 2 values 
Csharp :: c# azure get vm get cpu usage 
Csharp :: f# list map function 
Csharp :: C# oledb excel select column with space 
Csharp :: winforms lifecycle 
Csharp :: Unity Wait Time Fixed 
Csharp :: xamarin c# switch on hotspot Programmatically 
Csharp :: c# asp.net gridview selected row unselect 
Csharp :: C# if with obj params 
Csharp :: unity customize hierarchy window 
Csharp :: binaural generator 
Csharp :: ENUM error codes all 
Csharp :: unity check if transform doent have parent 
Csharp :: unfreeze position in unity 
Csharp :: tempdata serializer cannot erorr 
Csharp :: c# prototype function 
Csharp :: umbraco cannot start. a connection string is configured but umbraco cannot connect to the database. 
Csharp :: c# same folder path 
Csharp :: how to input data several times in c# 
Csharp :: get web api relative path 
Csharp :: start wpf application when windows start 
Csharp :: epmty char c# 
Csharp :: c# create dll runtime 
Csharp :: how to pass id to modal in asp.net mvc 
Csharp :: Delegates in UntiyC# 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =