0

I get an error saying: cannot convert from 'double to 'float'

when i try to do add

float scale = 0.4;

and set the vector 3 values to 'scale' i get an error as well

                    {
                    //Sets ramstick sprite when spawned and scales it down
                    Instance.transform.localScale = new Vector3(0.5, 0.5, 0.5);
                    Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("sprites/ramstick.png");

                    Instance.FixColliders();
                }
  • 1
    Change `0.5` to `0.5f`. – Dai Mar 02 '22 at 15:50
  • damn, i feel dumb xD – Kevin Løfgren Mar 02 '22 at 15:55
  • Please don't. It's a common gotcha. Everyone gets a free-pass for trivial mistakes like that - and it's not like you're asking how to encode a multi-gigabyte video file to a Base64 string in JavaScript, or if `tracert.exe` [shows live visitors to google.com](https://www.youtube.com/watch?v=SXmv8quf_xM) – Dai Mar 02 '22 at 15:56

0 Answers0