Search Unity

Collision problem with localScale

Discussion in 'Scripting' started by BlackHawkStudios, May 27, 2011.

  1. BlackHawkStudios

    BlackHawkStudios

    Joined:
    May 1, 2011
    Posts:
    107
    I am using the character controller component on my character, well I am trying to have the ability to shrink. Every frame I have it where the scale is set to Vector3(1,1,1); and when the button is pushed Vector3(.3, .3, .3). However when I start the game, he falls through the floor. What is the problem really?
     
  2. BlackHawkStudios

    BlackHawkStudios

    Joined:
    May 1, 2011
    Posts:
    107
    This is a similar code I'm using.

    Code (csharp):
    1.  
    2. function Update()
    3. {
    4. transform.localScale = Vector3(1,1,1);
    5. if(Input.GetButton("Shrink"))
    6.       transform.localScale = Vector3(.3,.3,.3);
    7. }
    8.  
     
    Last edited: May 27, 2011
  3. BlackHawkStudios

    BlackHawkStudios

    Joined:
    May 1, 2011
    Posts:
    107
    Bump, I really need some help with this.

    Thanks in Advance.