- Home /
Other
Getting Camera to follow falling Dominoes
Hi!
Im doing a game in Unity where the user is allowed to place down dominoes and knock them over. When the player does this I want a camera that follows the dominoes as they are falling down, however im not exactly sure how to do this?
If you only have a single row of do$$anonymous$$oes, then the algorithm is not too bad, but most do$$anonymous$$o setups will have multiple paths, one do$$anonymous$$o hits two others, starting two paths running. Do you follow one and ignore the other? For multiple paths, how do you deter$$anonymous$$e which one to follow (or even what ones are on what path), or do you pull the camera back so you can see both? What happens if the paths go in opposite directions? How do you orient the camera given multiple paths?
Answer by yoger · Jan 21, 2014 at 03:41 PM
Maybe do the script which will have variable (most likely game object or transform) that will be changed by each game object (domino) OnCollisionEnter() will bring you the collider and let you run the function that goes from one piece of domino to another.