Moving blocks
#1
Can anyone give me a push in the right direction with making blocks move, i guess i can create a variable of the block and move it like
Code:
block1:SetPosY(50)
but i dont know how to get a block element to use with this command? Huh
Reply
Thanks given by:
#2
You can't move blocks. See the world as a giant 3d grid (or table) and you can simply fill in the cells with a material (dirt, stone, glass, etc.). Cells always stay in the same position, so you can't move them.

If you want to give the impression of a moving block, you need to set the material of a cell to the material you want the block to be, and every time the block 'moves' you need to reset the old cell back to the old material (air maybe?) and fill the new cell with the block material.

Code:
World = cRoot:Get():GetWorld()
World:SetBlock( X, Y, Z, E_BLOCK_SPONGE, 0 )

This sets a block on coordinates [X, Y, Z] to a sponge material
Reply
Thanks given by:
#3
Oh right that answers a lot of questions Smile thanks a lot!
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)