Trying to weld individual instances in a circuit simulation

I’m spawning instances of an object eg. batteries, bulbs, resistors etc. I’m using the welding of collision objects to join components together. My two issues are

How to address the individual instances that are colliding, to visually weld them so they overlay.

I also need to work out how to identify whether there is the valid components welded together to form a circuit. I have had the idea of adding each connected game object to a list and running a very large if statement to see if there is the right components in it. However, this is not very reasonable and I was wondering what other ways there could be.

Hi Bingo Boy!

The scope of your questions is very wide and so it’s hard to answer properly. If I was going to do this, I would create a table with the components listed in order and write a function for each component depending on what it should do. However, if you don’t have much experience with defold/lua, that’s quite a complicated first project. If you look at the examples, you’ll get a better idea of how coding works, and that will give you an idea of how to carry out your own project.

1 Like