Programming created item

I am trying to use any sort of code on an item that is yet to be created but cannot figure out how.
Creating the item works of course, but as, when I’m coding, it does not exist yet, I cannot seem to make it available for coding. Any ideas of how to make it work?
I could of course make it invisible as a workaround, but I’m looking for a proper solution.

Thanks!
Sebastian

Did you notice that the input field for most “Choose an item” fields are round, and not square? What does that tell you about the input field?

Scroll down to the “Items” category, specifically the section named “Get.” Can you find any useful blocks there?

If you’re still puzzled, shoot me a reply and I’ll be happy to elaborate further.

1 Like

I notice, but unfortunately I am at a complete loss how that helps me. Inserting a Get-item does not work.

1 Like

Is this the approach you were trying?

On my end, this appears to work correctly. Perhaps you have a more complex setup that contains a mistake that makes yours fail.

I’ve taken a look at your CoSpace but you don’t have any sample trials, just your original code before you began trying things out. Unfortunately that means I can’t inspect it for any mistakes you could have made there when you tried to set things up.

1 Like

No I got it, thanks a lot!!
I can only add items from the create item drop down, right?
One of my students wanted to make a coin appear in a person’s hand after you have solved a riddle, so that would not work I guess

1 Like

Unfortunately so, there does not seem to be a way to dynamically manifest modeled objects from scratch, besides the basic shapes shown in the menu.

But did you notice that there is a block that can clone objects? What if you hide a template object out of sight?

1 Like

I guess then I can also just keep it invisible, attach it and make it visible at the same time.
Thanks for the super fast support!

Of course, it’s completely up to you how you want to do it.

I assumed you wished to create objects dynamically in which case cloning would be a great option there.

If you feel like CoBlocks are beginning to limit you, remember that variables can hold almost anything, unlike Scratch. You can even put scene items, lists of scene items, colours, and positions into variables. This can be very useful when you begin dealing with more complex setups.

1 Like