- Home /
Creating a "Connection" between two game objects using another game object.
I would like to have a game object act as a connection between two other game objects, sort of like a power line. The player places down an object that scales up to fill the gap, if it connects with two objects then the one object "Enables" the other.
I've almost managed to get the scaling right using a Coroutine that scales the object using a boolean. This boolean checks for collisions and becomes false when the object collides with another, stopping the Coroutine. I have to use two connections shooting out from a central object. My main problem is making the connection between the two objects (A and B). My question is whether or not this could be achieved by storing multiple collisions in an array or list and comparing the tags of these game objects. How would I go about doing that? Any help would be appreciated.
This is a bit vague.
What does the connecting gameobject need to be? Is it a mesh you can generate or is it modelled?
If so why not just generated it with one end of it positioned with gmaeobject A's position and the other end of it positioned with gameobject B's position?