Hello Constructors :)
I generated instances of a 3d object using For Each loop. For some of these objects I'd like to change textures of certain sides (faces) of the objects using code. I seem to struggle to achieve that.
The idea is a modification of a Free Demo game called "3D Maze Castle", where they populate 2d map using 2d objects, then use For Each loop to generate 3d objects based on the placement of the 2d objects.
Here is what I did:
* I have a 3d object created under Object Types called 'Cube01'. It has bevaviour Solid.
* I have a 2d object created under Object Types called 'MapItem'. It has bevaviour Solid.
* I placed instances of 2d item on the map.
* Using code: (on start of layout) System -> For each MapItem -> System -> Create object Cube01 on layer Background at (MapItem.x, MapItem.y) ...
* Using code assign a variable to 3d objects, inside the For each loop: Cube01 -> Set Cube01UID to MapItem.UID
The above works ok.
Now I tried to add the following code:
* (on start of layout) Cube01 -> Cube01UID = 2 -> Cube01 -> Set Back face to use image of Hand (Hand in another object with a different texture)
The program runs, but the last line doesn't seem to have any effect, the texture does not change.
I tried replacing 'Set Back face to use image of' with 'Set color to rgbEx(0,0,0)', but it also has no effect under Preview.
What did I do wrong? How can change texture of a selected face (let's say Back face) of 3d instances of an object for certain UIDs?