Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by robertofantasy · Jul 19, 2012 at 02:15 PM · camera follow

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);
  
  }
 }
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vlamor · Jul 19, 2012 at 03:16 PM 0
Share

Try to use camera1.transform.LookAt(capsule.transform);

avatar image robertofantasy · Jul 20, 2012 at 07:14 AM 0
Share

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

avatar image syclamoth · Jul 20, 2012 at 07:15 AM 0
Share

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!

avatar image robertofantasy · Jul 20, 2012 at 08:00 AM 0
Share

yes that obvious but that help in some cases because they are very brief

avatar image syclamoth · Jul 20, 2012 at 08:03 AM 0
Share

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.

4 Replies

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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 ?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by MrScottyPieey · Mar 14, 2019 at 08:33 PM

This is old and outdated please make a new one.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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

I've got a lock On system Working, except for my camera is not sticking with my player meaning the character can walk out of view, any ideas? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges