Hi everybody.
Im a beginner with only a few days of coding and I need help with "spawning" a box.
Its just the start of a long line of questions, but how do I do that?
My code is as follows:
//------------------------------------------------------------------------------------------------------
function EditLevel() //Adds object to the left of characters position
texture = LoadImage("skull-white.jpg") // Load image from the media folder called skull-white.jpg and assigned its ID to an integer variable called "texture"
MyBox = CreateObjectBox(1,1,1) //1 equals size in X,Y,Z
MoveObjectLocalX(MyBox, PlayerOne.ID -1)
MoveObjectLocalY(MyBox, PlayerOne.ID)
MoveObjectLocalZ(MyBox, PlayerOne.ID)
RotateObjectGlobalX(MyBox,0) // Rotate the box if you need to
RotateObjectGlobalY(MyBox,0) // Rotate the box if you need to
RotateObjectGlobalZ(MyBox,0) // Rotate the box if you need to
SetObjectImage(MyBox, texture, 0) // Assigns the texture image to MyBox in texture layer 0
sync()
endfunction
//------------------------------------------------------------------------------------------------------
I am calling the funtion in my player movements with this simple line:
if(GetRawKeyPressed(KEY_E))
EditLevel()
endif
//------------------------------------------------------------------------------------------------------
What am I missing here?
Any help appreciated!
-Jonas