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 N30N · Apr 15, 2015 at 02:43 AM · cameramobileplatform

How to align camera when character goes off screen

My platform mobile game has a maximum of only 8 platform on screen. there are more above the screen. the camera can't see all of it. I want to make the camera follow the character when I reach a certain point.

There's a spawn point all the way at the top of camera that drops water. If the camera scoots up, how do I scoot the spawn point up with it too?

If anyone can help, I would appreciate.

screenshot of my game:

alt text

capture.png (5.4 kB)
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 Olgo · Apr 15, 2015 at 02:59 AM

The spawn point, is it a gameObject? If so, I would make it a child of the camera at its current position. That way, it will always move with the camera, and always be the same height in relation to the camera.

To move the camera once the player reaches a certain point... there are many ways you could do this. The first and simplest way that comes to mind:

Look up "Camera.ScreenToWorldPoint"

http://docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html

This allows you to choose a point on the screen, then convert it to a point in your game world. You could compare the character's position.y value vs the screen to world point's y value. If the character is above that point, move the camera up.

Comment
Add comment · Show 2 · 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 N30N · Apr 15, 2015 at 03:03 AM 0
Share

yes, the spawnpoint is empty gameobject that spawns a prefab water. it's placed slightly above the camera's view. If i move the camer up, the water will then drop halfway on the screen and that's not right.

avatar image Olgo · Apr 15, 2015 at 04:13 AM 0
Share

In the Heirarchy view, drag the spawnpoint on to the camera, it will become a child of the camera, and maintain its position in relation to the camera as the camera moves.

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

19 People are following this question.

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

Related Questions

Calibrating Accelerometer Values 1 Answer

New to unity -1 Answers

Mobile touch input conflicts 1 Answer

Isometric camera skybox not working. 0 Answers

Weird Behaviour WebCamTexture to GUITexture 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