- Home /
Unlikely Script Error with Matrix4x4.TRS
This piece of code gives the errors:
GUI.matrix = Matrix4x4.TRS( Vector3.zero, Quaternion.identity, Vector3( (float)Screen.width / nativeWidth, (float)Screen.height / nativeHeight, 1f) );
" Assets/Scripts/UI-MAP/GUIMain.cs(46,40): error CS1503: Argument #3' cannot convert
object' expression to type UnityEngine.Vector3'" "Assets/Scripts/UI-MAP/GUIMain.cs(46,80): error CS0119: Expression denotes a
type', where a variable',
value' or `method group' was expected"
Whereas this one doesn't: I couldn't figure what this is about, hope you can help me thanks.
float rx = (float)Screen.width / nativeWidth;
float ry = (float)Screen.height / nativeHeight;
Vector3 vect = new Vector3(rx, ry, 1f);
GUI.matrix = Matrix4x4.TRS( Vector3.zero, Quaternion.identity, vect );
Answer by whydoidoit · Nov 23, 2013 at 08:00 AM
You've missed the "new" in front of Vector3
Answer by arlinon · Nov 23, 2013 at 12:21 PM
Tried again, looks fine now. Maybe I just had forgotten to save the script before running. Thanks!
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Change screen resolution button in pause menu? 0 Answers
Official Unity Space Shooter Tutorial 1 Answer
Tracking Down GUI Errors 0 Answers
I can do this in JS or not ??? 2 Answers