Hi all
I am putting together a molecule building game/prototype. I have the basic building blocks all there, so “atom” gameobjects create joints to connect to each other etc.
What I am struggling with is a good approach to detecting what molecules are connected with each other and then how to work out when a certain atomic combination has been reached, in this example it is water.
So my general thinking is when one atom connects with another a group is formed (maybe a list or an array and searching by tag?) then when others are added they also join this “group” with a manager running in update() constantly checking these groups to see if a molecule is created.
I have thought about creating a list when one connection is made for example, but then would I need to create a list based off that initial connection? For example, I want to also be able to create an oxygen molecule (2 oxygen atoms) so if the group included an oxygen and hydrogen atom, the manager would need to know the difference of what is in the group and react accordingly.
I’m still fairly new to c# so I think it’s just a case of missing some framework knowledge. So if anyone can point me in a general direction to research that would be great.
I hope my ramblings make sense.
cheers
Matt

