[Closed] noobie problem
hello
i am experiencing a problem about variables declaration…
As i’ve read, maxscript don’t need to declare before usage…
Although, i have that
Bdisp=(XBL+XSL)/2
s.pos = [Bdisp,0,BW]
and for
XBL=100
XSL=1
BW=4
it returns [50,0,4]
i can’t understand what s wrong with it…
anyone?
not sure what you are after. But you need to variables declaration before you use it. So shifting the order, this would work fine
s = Box lengthsegs:1 widthsegs:1 heightsegs:1 length:10 width:10 height:10
XBL=100
XSL=1
BW=4
Bdisp=(XBL+XSL)/2
s.pos = [Bdisp,0,BW]
Thank you for your answer.
I did this, someway, and the problem was that even though you don’t need to declare variables, they became the type of the first value i give to them.
so i made the
XBL=100 –> XBL=1001.0
XSL=1 –> XSL=11.0
BW=4 –> BW=4*1.0
and it worked fine…
still some problems in the script… i m working on it…
thank ypu again
if you need floats just simply define them in a float format:
XBL=100.0
XSL=1.0
BW=4.0