|
Hi there! I'd like to have a script for camera folowwing a gameobject which is found in this sctipt by tag. Well, I know how to find the GameObject, but I've no idea how to create a following camera with first-person view. Help, please! **I'm using C#, would be nice if you will also use it for the explanation :)
(comments are locked)
|
|
Awesome! So a bit more of an easy question to start. Usually in the Answers we won't just write your code for you. But I guess I'll be the exception. You don't have to have the actual object scripted to follow the player unless in 3rd person. You can just drag the Camera as a child to the object itself. But besides that here we go. This will be the final player instance in which we will use. GameObject Target; Now that we have created the variable for the final target we have to go ahead and define the target itself and apply the actual movement of the object. Thats really all that you need to do to apply a child. Is change Transform.parent to the parent transform. More info in the Unity Scripting Reference: http://docs.unity3d.com/Documentation/ScriptReference/Transform-parent.html Thanks a lot! You really helped me!
Aug 29 '12 at 06:35 AM
arcadia
Glad to know that I could help!
Aug 31 '12 at 01:27 AM
Devon Hall
Also if this is the final answer you needed you can accept it as a final answer so people searching for similar questions can reference this as a complete question and answer.
Aug 31 '12 at 01:27 AM
Devon Hall
(comments are locked)
|

http://wiki.unity3d.com/index.php/Scripts/Controllers
Have you already looked at "Standard Assets/Scripts/Camera Scripts"?