- Home /
Camera following dice with FREE UNITY DICE PACK. help
i really need some help with this one . this is a quick download , i need a camera to follow one of the dice when it is spawned . when you download the pack go to the AppDemo.cs script and omit
// Dice.Roll("1d10", "d10-" + randomColor, spawnPoint.transform.position, Force());
there should be 8 of those lines of code , omit 7 of them so you have only 1 rolling dice . i need to zoom a camera on it when it is spawned . could you help me to do this , thanks you in advance
Answer by Owen-Reynolds · Sep 05, 2012 at 11:13 PM
A typical camera script has something like `public Transform target;` and it tracks that. Just have your code do something like `cameraScript.target=theDie;` when you roll.
When you're done, set it back to whatever it was before. Make sure it's a camera script that tracks only position and not also rotation (or it spin like crazy with the die.)
i have tried but unfortunately this code is not giving me a break .the game object seems to be named in script and created during spawning but i cant get a break .............i'm having a headache x_x
Could always try `GameObject.Find("d6 (clone)").transform;`
i have tried exactly that over and over and over and i get nowhere with it . i would be mortified if GameObject.Find("d6 (clone)") actually worked for you Owen =0