So I’m working on a mini project based on the Lego Microgame files, and I’m trying to combine Pickup, Counter and Touch Trigger behaviour bricks against a crystal object to add one to the score counter when the player jumps into it, and then use a separate trigger on a platform to move it to the player.
This works with all three combined, however the crystal is invisible - it appears fine in scene view, and also shows fine in game if I remove the Pickup behaviour brick. Similarly I can apply the Pickup behaviour on its own to other objects and they show/work fine, but obviously not in the way I want them to. Weirdly, if I untick the object in-game and retick it, the particle effect then shows (but still not the object itself).
I appreciate this is a very specific question to people who are familiar with the microgame, so if anyone has used it a lot I’d massively appreciate any help - alternatively are there any general debugging tips you would recommend?
Check for things like layers… it’s possible that they configured the camera to NOT render certain layers, then they can just move something to such a layer to make it unobtrusively stop rendering for a bit while remaining active.
I’ve run into the same issue, and haven’t really found a solution yet. For some reason they hide the bricks through the part renderer flag in the initialization part of the Pickup behavior.
// Make invisible.
foreach (var partRenderer in m_scopedPartRenderers)
{
partRenderer.enabled = false;
}
The m_scopedPartRenderers comes from the base LEGOBehaviour class and is set in the GetBounds function. However, I’m not sure why there are no part renderers present with only the Pickup behavior attached? You can make the bricks visible by not hiding them, this will however stop the rotation part… I’m a bit confused.
I think perhaps part of the problem might be some automation or implicit script behaviors that Unity’s LEGO script brick thingies do, and that might be less-visible than your own scripting, or interacting with it in odd ways. I don’t have the LEGO project handy here but that might be some places to look for, see if their code does anything “extra” that you wouldn’t expect it to. No easy way but to sorta study it and instrument simple bricks of it to see.
Not really a great solution but if you change the target in the trigger script to ‘specific action’ and select the counter action. The lego brick will then appear in your game. However the count action than doesn’t work!