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 JeyDia · Apr 11, 2013 at 01:01 PM · camerascreentoworldpointshipshmup

An object who stay in the camera area

Hello

I'm making a shoot them up game and I want that my ship stay in the camera area

I know that I must use Camera ScreenToWorldPoint but I don't know how

Thank you

Comment
Add comment · Show 8
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 Vonni · Apr 11, 2013 at 03:29 PM 0
Share

2D Game? 3D game? Sideview? Top? Free movement within the camera view? Following Ship?

And if you need to use ScreenToWorldPoint (which i doubt you need), then I suggest you check it up in the Unity.Doc (Help/ScriptReference). It basically used a camera of your choice, takes a Vector2 position ( Using pixel values ) and converts them to a Vector3 position.

avatar image robertbu · Apr 11, 2013 at 03:35 PM 0
Share

With this description, it is difficult to help you. What is moving? The ship? The camera? When do you want to do the correction? How is the ship moved? Using a Rigidbody and adding force or are you directly manipulating the transform? You might want to take a look at:

Camera.WorldToViewportPoint()

avatar image JeyDia · Apr 11, 2013 at 04:43 PM 0
Share

2D Game Front view with an ortographic camera, the camera is moving with a Vertical Scrolling, the ship with a rigidbody is moving too

avatar image robertbu · Apr 11, 2013 at 05:04 PM 0
Share

Viewport coordinates go from (0,0) in the lower left to (1,1) in the upper right. So you can tell if you are nearing the edge of the screen. Using a Rigidbody() makes the problem somewhat more difficult. You either have to change the velocity of the ship or change the speed of the camera as the ship approaches an edge.

avatar image JeyDia · Apr 11, 2013 at 06:06 PM 0
Share

and How I can limited the movement of the ship with that ?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Apr 11, 2013 at 03:50 PM

Pick one:

  • http://answers.unity3d.com/questions/176149/how-to-restrict-caracter-movement-to-visible-area.html

  • http://answers.unity3d.com/questions/202673/25d-shooter-rescrict-movement-to-camera-view.html

  • http://answers.unity3d.com/questions/39060/boundaries-movement-constraints.html

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

12 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

Related Questions

Healthbar follow with screenspace-camera canvas 0 Answers

Camera Screen to world point returns cameras transform position. 8 Answers

Camera not being moved when dragged by mouse 0 Answers

Projecting Oblique Screen Coords to Straight World Coords 1 Answer

Camera ScreenToWorldPoint Instatiating 1 Answer


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