Changing sprite for a beginner

i want to make 2 characters… both pill shaped. i want one to grow triple its size, and one to shrink so it is the shape of a ball…

i have the growth set up and used vectors. I tried to basically do the same code but in the opposite. Only to realize i cannot half vectors. What can i do to make the pill turn into a ball? here is what i have so far.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Shrink : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        transform.localScale = new Vector3(1, 1, 1);
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown (KeyCode.Q))
        {
            Debug.Log("Q Button Pressed");
            if (transform.localScale == new Vector3(1, 1, 1))
            {
                transform.localScale = new Vector3(0.5, 0.5, 1);
            }        
            else
            {
                transform.localScale = new Vector3(1, 1, 1);
            }
        }
        
    }
}

Any help for a rookie will be appreciated!

You need to put an “f” behind the numbers, because now its a float number and not an integer anymore.

I think that should work:

transform.localScale = new Vector3(0.5f, 0.5f, 1f);

I always put an f behind every number that doesnt have to be an integer in the context, it helps me to avoid these kinds of bugs. So id also put an f behind the 1, even if its unnecessary.

Hope that worked ^^

Thank you, it did work. unfortunately it does not look like the sphere i would hope i guess i should just have it change to a sphere instead of messing with the vectors

yeah, any idea how to change it to a true sphere instead of messing with vectors?

You could have different playerModel gameObjects nested in your Player and switch them on and off depending on the circumstance.
I do that with my colliders for crouching and sliding.
I can show you my code tomorrow and also tell you how to apply it on your circumstance.
You should open a new discussion for it, I’ll check it out tomorrow ^^