Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 PdrMnts · Sep 07, 2017 at 12:47 PM · objectvector3quaternionforwardplace

How place object in forward direction of the camera, even if camera is pointing to the ground or the sky?

I want to place one object in front of the camera, always at the same distance...

So if I am looking the ground, the object will be also at the same distance that if I am looking forward.

At this moment I am able to place the object at 2 meters when I am looking straight but If i am pointing to the ground with the camera , the object is placed closer than 2 meters.

Thank you

EDIT: Okey , I already did it.

object.transfrom.position = camera.transform.position; object.transform.rotation = Quaternion.Euler(0,camera.transform.eulerAngles.y,0); object.transform.Translate(Vector3.forward * 2 , Space.Self);

and thats it :D

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

2 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by YasinJavaid_ · Sep 07, 2017 at 01:15 PM

add projector component to some gameobject and make child of camera make it orthographic and u can also mange it with 2 cameras by handling layers. assign layer to object and 2nd camera assign only that layer you achieve what you want. ask anything you need further. thanks

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 connorwforman · Sep 07, 2017 at 09:20 PM 0
Share

I have no clue what this means, but it looks correct so it will work better than $$anonymous$$e.

avatar image YasinJavaid_ connorwforman · Sep 08, 2017 at 05:30 AM 0
Share

two methods for this. 1) using projector component apply desire material set to orthographic make child to camera.

2) using one extra camera that one see the object that appears on screen in specific location. set desire layer to game object like "$$anonymous$$e" create new camera clear flags set to depth only set depth with according to other cameras in culling mask set "$$anonymous$$e" layer only. and in game view set your object in desire location.

avatar image
0

Answer by connorwforman · Sep 07, 2017 at 12:55 PM

Drag and drop the object under the camera, and when your player with the camera moves, so should the object. If you haven't attached it already, drag the camera under the player.

Comment
Add comment · Show 1 · 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 PdrMnts · Sep 07, 2017 at 01:00 PM 0
Share

$$anonymous$$mmmm. I think you didnt understand the question. I need to place one object in front of the camera at the same distance, no matters if the camera is pointing down or up.

Not attach it to the camera, because if I do that when i move the object will be always at the same distance.

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

88 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 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 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 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 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

Vector3.forward only moves me in 2 directions when rotating 1 Answer

How to use Quaternion to rotate an object in only one axis? 1 Answer

Planetoid Gravity 1 Answer

how to drop an object when the object is set in Camera.main.ScreenToWorldPoint 0 Answers

calculating looking angle between 2 transforms 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