Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What an awesome programming language

Name: Anonymous 2012-10-09 14:34

Pretty much any language other than C#:


  gun.transform.localPosition.x = newPos;


C#:


  gun.transform.localPosition.x = newPos;

error CS1612: Cannot modify a value type return value of `UnityEngine.Transform.localPosition'. Consider storing the value in a temporary variable


Suggested C# workaround:


  gun.transform.localPosition.x = new Vector3(newPos, gun.transform.localPosition.y, gun.transform.localPosition.z);


10/10 would bang

Name: Anonymous 2012-10-09 14:48

this is why javascript is the future; operator overloading actually works correctly

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List