OK, so just starting out on Firefly. Done some tutorials. All seems fine and straightforward.
Tried (Dispite a complete lack of comments in the code or naming of assets) to understand the race car example in the store, which is what I've been deconstructing and messing with to learn the system.
Think I'm all on board with how it works, but I'm a little stuck on something rather simple.
I want to draw my level in 2D (top view) in the MMF editor, then load in 3D assets via code at runtime.
At the moment I have a ForEach loop that cycles through a bunch of PinkSquares (active objects) and uses their positioning to spawn/position a bunch of Firefly Primitive Cubes (that I'm using for walls).
The problem I'm having is that if I set the 3D Primitive's position in the ForEach loop it works, but if I try and load a material into it, it doesn't.
(the following only runs once):
On Each one of WallPositioner, loop name "makeWalls"
->Create Object Primitive
->Set Object Primitive position (blah)
->Load Material 4 in to slot 0 of Object Primitive.
Run the game, no materials on walls.
If I brute force it (load material on walls when key pressed), it works. So it's not the primitive, I think it's some issue with the forloop.
I've hacked the small bit of my code where I'm having the problem out, and attached below with comments. Look at the event editor and it should explain what I'm trying to do.
Any help appreciated!
I should stress that while I realise there are other ways to do this, I will eventually want to load a large number of assets At the start of the level and using a foreach will be essential to that.