- Home /
How to code for the camera recap the respawned objects?
Hi all Unities,
Could any one please write to show me how to make the camera recapturing the respawned objects? I were using the camera swtching method ( or codes ) from the 2D gameplay tutorial which downloaded from the Unity3d official website but it appears that I could only using it for instant object that before the game is actually playing then if I used it on the respawned objects it wouldn't function as expected so any high help appreciated and please?
Regards, Unity4DNoob.
Answer by poncho · Apr 14, 2011 at 01:32 PM
i think that camera class have a target you can try telling your camera to change its target to the new respawned object if dont, use the variable that is used to make the follow part and change to the gameobject you want. hope this helps
the variable was "targets:Transform[]" so since it's array maybe bcos I am noob so not that efficiency on array coding but wondered if Unity handling array effectively? lol redo again...
i guess there should be an index that keeps the main target like targets[index], try changing the value from where is set, also you can check if they render.enabled is true, just in case
Your answer
Follow this Question
Related Questions
2D Gameplay Tutorial - Main Camera 1 Answer
How can I detach a 2d object from 3d environment? Detach it from the 3d. 0 Answers
2d axis is not shown 1 Answer
Help, please with rotation input 0 Answers