minmaxslider problem (Javascript)

Hi,

I using a custom editor script, and want to modify two variables at the same time using a minmaxslider.
Here’s the code for the line I’m using:

EditorGUILayout.MinMaxSlider(target.elementArray_.randomYFOstart, target.elementArray*.randomYFOend, 0.0, 1.0);*_

Both of the first two things are variables from an array of objects, but I get the following error code:
No appropriate version of ‘UnityEditor.EditorGUILayout.MinMaxSlider’ for the argument list ‘(System.Object, System.Object, float, float)’ was found.
I don’t understand why Unity thinks those first two things are System.Object when they are defined and set up as float variables in the main script this editor script refers to.
I have loads of other variables, set up in the same way, feeding perfectly into the editor script as IntSliders, Sliders, TextFields etc. etc.
What am I doing wrong?
I read on here (in the only other question relating to minmaxsliders) that in C# you need to add ‘ref’ to the beginning of the first two items, but that confuses the hell out of Unity.
Anyone help me?
Thanks!

This error usually appears when Unity doesn’t know the argument type - specially when you use #pragma strict in your script. You can assign the values to two float variables and use them in the function:

var start: float = target.elementArray*.randomYFOstart;*
_var end: float = target.elementArray*.randomYFOend;*_
_*EditorGUILayout.MinMaxSlider(start, end, 0.0, 1.0);*_
_*
*_

And don’t abandon Unityscript so soon! It’s easier and much more concise - the ideal language for scripts, in my opinion. C# requires much more writing, and is like a cranky old aunt, complaining all the time about everything: hey, you must write “0.5f”, not “0.5”, stupid! you must declare “new Vector3(x,y,z)”, not just “Vector3(x,y,z)”, you incompetent! and so on…

That did the trick perfectly, than you so much!