Hi, I'm very appreciated with this groups and very kind people. Thanks.

12 views
Skip to first unread message

박정민

unread,
Aug 21, 2017, 2:20:39 AM8/21/17
to CoSpaces Scripting
I uploaded on website. And Its name is 'pica'. With coding block, I want to set the first position. So I wrote the script like this; pica=Scene.getItem('PE0rAqDy2c' ,0, 0, 0);

But when I play the project, position of pica is not (0, 0, 0)

With 'getItem' method, I wanted set the position of pica (0, 0, 0). What's wrong with this? What did I wrong?
2017-08-21 15;12;54.PNG

Stefan Filff

unread,
Aug 21, 2017, 3:38:30 AM8/21/17
to CoSpaces Scripting
Hi,

the getItem() method returns the item you want to modify. To change the position, you need to use the method "setPosition" on the item. 

This is what needs to be in your coding block to move the pica item at the start of the scene to position 0,0,0.
Scene.getItem("pica").setPosition(0,0,0);

However, you don't need to use the coding block for this. You can simply use the "move To" block you have been using in your IF statement, too. Here you can see how both blocks do the same thing:


Cheers,
Stefan
Reply all
Reply to author
Forward
0 new messages