Help with a symbol

I am making a symbol I will be using in my zapbox later. It has 4 3d symbols in it. The 3d symbols look go when you look at each one but when I place them in the main they look like a plane. I can change their position and the rotation and you can tell it’s 3d but still shows flat like a plane. Any help or pointers would be welcome.

Steve

1 Like

Ok forget what I asked for. I have new problem.
I have a symbol which in it has a 3d file and a TriggerRegion. I have added the symbol to a zapbox world. I can see the 3d box but it will not work with the trigger from my controller . I have set the Trigger tag to match.

Now I copied the code and 3d box to the world and things work there. So I guessing the zapbox controller is not seen in my symbol.

How do I get it to see the TriggerRegion in my symbol?

Steve

Hi Steve,

Have you made sure that you’re setting the tag of the 3d model node inside the 3d subsymbol? If you’re setting the tag of the instance of the 3d model subsymbol then it won’t work.

Thanks,
Mark

Thanks mark, but I think that’s what I have.

in my SubSymbol I have.
3d pod file
TriggerRegion
script

The TriggeRegion TriggerTag is set to the same as the tag of the TriggerPlane that is outside the SubSymbol grouped with the Controller.

Block-Zapbox.zpp (707.4 KB)

Hi Steve,

If you’re using tags across symbols you need to make sure to have the tag name starting with “global:” as mentioned in our tags article.

Give that a go :slight_smile:

Thanks,
Mark

Mark,
Thanks for the info. I was thinking I needed an export or something like it.
But after testing still no go.

Block-Zapbox-pushTag.zpp (707.5 KB)

Steve
Ps. I would check your tage article there is a “5” in the word “that” under TriggerRegion Detection.

Hey Steve,

In that zpp the triggerRegion within your ‘select block’ subsymbol was using the tag ‘myTag’ which was not using the ‘global:’ prepend so that’s why it wasn’t working.

Changing that fixed it for me, unless your issue was elsewhere.

I’ve now fixed that typo too, cheers.

Mark

You rock Mark!!

I didn’t understand that “global:myTag” was the new name for my tag. I thought the “global:” was a prefix just to tell it to be a global tag.

Thank you!!
Steve

New question about TriggerRegion.

I have a TriggerRegion that when “on”, after 3 sec it will run a function.
I’m trying to stop it from running when leaving the TriggerRegion like the .off code here
https://docs.zap.works/studio/scripting/reference/base/functions/off/

But I can’t seam to get to work.

my code:

triggerRegion0.on(“triggerenter”, (e) => {

// Get state of Block
StateOfBlockFunction();

// Wait 3 sec before changing block
Z.after(3000, function() {

ChangeTheStateofBlockFunction();
});
});

// Leave Block
triggerRegion0.on(“triggerleave”, (e) => {

HSCube0.visible(false);

triggerRegion0.off(“triggerenter”, ChangeTheStateofBlockFunction);
});

Can’t see what I’m missing.

Thanks
Steve

Hi Steve,

That’s not quite how the off function works, once you have called Z.after that function call will run regardless. I suggest you put your check in the function you’re calling. You can create a boolean variable that is set to true on triggerenter and false on triggerleave and then check that within your function to determine if you want to run any code or not.

Thanks,
Mark

Mark,
Thanks. When I couldn’t get it to work I was thinking I may have to do something like that.

Thanks,
Steve