- Home /
camera follow problem
i write scripte the my camera follow the capsule but it not work please help
using UnityEngine;
using System.Collections;
public class camera : MonoBehaviour {
void Update ()
{
GameObject camera1 = GameObject.FindWithTag("MainCamera");
GameObject capsule = GameObject.FindWithTag("Respawn");
Vector3 campos = camera1.transform.position;
Vector3 capsulepos = capsule.transform.position;
campos = new Vector3(capsulepos.x,capsulepos.y,capsulepos.z);
}
}
ok fellas i need that the camera follow and look at my target
and if you can with c# example show me how to work with
gameobject.find()
gameobject.findwithtag()
and please dont reffrence me to unity documentation
Why not reference you to the Unity documentation? It has all the information you need. You need to learn how to do things for yourself some day!
yes that obvious but that help in some cases because they are very brief
It's obvious from your posts here that you expect people to just provide you with a completed game. You need to understand that that simply isn't going to happen.
Answer by Nsmurf · Jul 19, 2012 at 04:45 PM
If you mean 3rd person camera, there are scripts in the character controllers for 3rd person. just put the script on the capsule. you could also check out the angry bots demo that comes with unity.
Answer by vlamor · Jul 19, 2012 at 05:12 PM
Does the camera look at capsule? Camera will only look at your capsule. It doesn't follow. To allow camera follow a capsule you can use scripts from standard asset Third Person Controller.
Answer by robertofantasy · Jul 21, 2012 at 08:34 AM
ok my friends you catch me the fact is that i have university project and i have no time to do a complete project so i want a 2d scrolling shooter project that from that project i made myself a game
you got it ?
Your answer
Follow this Question
Related Questions
Camera follow Avatar 1 Answer
How do I disable 2D camera follow when my player collides with a trigger object? 0 Answers
How to set the follow distance to a target object when using the “Multipurpose Camera Rig”? 3 Answers
Make a sphere rotate the opposite direction a player is looking in VR 1 Answer