ScriptSpot

Forum topic · General Scripting

CAN NOT MOVE OBJECT CREATED BY STRUCT

By alexnguyen · 2016-02-28

Description

I have an idea , i want create a plugin . I try to create object in struct but i can not move it . Can you help me ? Sorry my bad enligh

struct BoxStruct
(
-- Fields
w,l,h,

-- initialize Function
fn _init = (
if w == undefined then w = 10
if l == undefined then l = 10
if h == undefined then h = 10
Box width:w length:l height:h
),

-- Do initialize
init = _init()
)

BoxObj2 = BoxStruct()

--PROBLEM HERE I CAN NOT MOVE IT

move BoxObj2 [19.2515,0,0]

Comments (2)

thank

alexnguyen · 2016-02-29

you save my day :)

fajar · 2016-02-28

youre moving the struct not the object....


struct BoxStruct
(
-- Fields
w,l,h,

-- initialize Function
fn _init =
	(
if w == undefined then w = 10
if l == undefined then l = 10
if h == undefined then h = 10
Box width:w length:l height:h
)

-- Do initialize
-- init = _init()
)

BoxObj2 = BoxStruct()
myBox = BoxObj2._init()

--PROBLEM HERE I CAN NOT MOVE IT

 move myBox [19.2515,0,0]