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
1
Question by chrisPOD · Mar 14, 2011 at 02:07 AM · cameracollisionmovementtransformtrigger

move camera when it collides with a trigger

Hello, ive been trying to move a cameras position when the character collides with a plain that i have set as a trigger.

What ive got doesnt work at all. Ive tried to set up two cameras so that why when i collide with the trigger it will disable one camera and turn on the other. I also tried to set a transform and move the camera to an empty game object(which i dont even know if thats possible).

To explain even more, if you have ever played LITTLE BIG PLANET you can tell that they have camera pathes or some kind of system to move the camera to different places. This is what i would like to do in my 2.5d side scroller.

would some one please explain to me how i could get this to work because this is a big part of my game.

Thanks for the help and consideration.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AngryOldMan · Mar 14, 2011 at 02:28 AM

if you want static cameras that change when you exit their viewing area (which you will have to match with a trigger area!) its just a case of parenting the camera to each game object then setting it by default as off. Then add a script to the game object for OnCollider Stay like:-

GetComponent ("camera")
{
   camera.enabled = true
}

warning not tested for errors! if your trying something that involves the camera moving then you need to script something to parent camera to player in certain trigger areas similar to this http://answers.unity3d.com/questions/44919/super-meat-boy-styled-camera/44956#44956 (take a look at answer's comments too)

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

No one has followed this question yet.

Related Questions

How to translate a camera forward and back(basically a zoom) according to the distance of two objects? 1 Answer

Move an object on collision 1 Answer

Detect collision/trigger between two body without rigidbody? 3 Answers

Multiple Colliders malfunctioning 0 Answers

How having correct bounce on a rotating pinwheel(it's more complicated)? 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