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 george_vasilchenko · Feb 11, 2015 at 05:04 PM · cameralinerenderervectorvertex

Line Renderer is not being updated in the Game window

Hey folks,

Please give me a suggestion of what might be wrong.. I have created many different vectors (light, normal, tangent, binormal, view) for each vertex. The problem is that if I play my scene, in the editor everything works correct, however, in the game-view I don't see my vectors being updated. Here is a link to the video: http://youtu.be/UmkABJDkOCk 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 hexagonius · Feb 11, 2015 at 05:17 PM 0
Share

I think it just looks like they were not updated. In the Editor window you're watching the scene from a static point of view, but in the game you're rotating the camera around the object. For the game cam everything seems to be static, because everything is calculated upon it. The editor cam is seeing those changes. I can't say which vectors you mean exactly, but for the view vectors for example, if you view the cube from the side in game view and choose a top down in the editor, I bet they all point towards the camera in parallel.

avatar image george_vasilchenko · Feb 11, 2015 at 06:03 PM 0
Share

Hi, my view (cyan) vector points to the camera direction (not position), light (yellow) vectors point in the direction of my directional light, white - half vectors (light + view) point half way between light and view. the rest are static normal, tangent and binormal. I am interested in the vectors that are being updated in the editor view (half vector specially) and not in the cam view.

avatar image hexagonius · Feb 11, 2015 at 06:26 PM 0
Share

How about adding [ExecuteInEdit$$anonymous$$ode] to the classes rendering your vector Gizmos and referencing Camera.current to access the Editor Camera?

This might also be interesting as there's a lot going on customising the editor window: http://code.tutsplus.com/tutorials/how-to-add-your-own-tools-to-unitys-editor--active-10047

avatar image george_vasilchenko · Feb 11, 2015 at 06:58 PM 0
Share

Thanks for the juicy tip, I always wanted to do something with editor and related stuff, however, I don't yet have enough knowledge about it... Never used what you have suggested. Could you please give me more information about camera.current.. ?

avatar image hexagonius · Feb 11, 2015 at 07:07 PM 0
Share

I am not as good myself. Since I don't know how you calculate your vector gizmos I can't really say anything about this. All I know is, that when not in play mode an setting the Attribute [ExecuteInEdit$$anonymous$$ode] to all the classes that render the gizmos, Camera.current should return the actual Editor camera in their Update()s , not the game view camera. You should then be able to base your gizmos on its values. I don't think I have any more knowledge on that matter myself, sorry.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hexagonius · Feb 11, 2015 at 07:22 PM

Ok, here it goes (hopefully):

Put [ExecuteInEditMode] right above the class declaration above line 7 in ShowVectors.cs Replace every Camera.main. with Camera.current.

If I am correct that should show the linerenderers without pressing play AND use the view vectors of the editor camera.

Comment
Add comment · Show 3 · 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 george_vasilchenko · Feb 11, 2015 at 07:29 PM 0
Share

Ill try it later on man, thanks infront!

avatar image george_vasilchenko · Feb 11, 2015 at 10:37 PM 0
Share

Hello, Unfortunately it didn't help, ins$$anonymous$$d, it completely messed everything up. Firstly, when I have changed camera.main onto camera.current, I got null-ref-ex at the point of the fist swapped camera code (probably all other places in code would give me the same). Secondly, compiler started to yell about leaking meshes, that I have to use shared$$anonymous$$esh ins$$anonymous$$d of just $$anonymous$$esh at the line where I reference $$anonymous$$eshFilter component .mesh. And lastly, some messed up lines appeared on the screen that didn't make any sense. Sadly enough it didn't work out. I suspect I could have not done something additionally maybe... I don't know. But thanks anyway, I'll be searching for solution further!

avatar image george_vasilchenko · Feb 12, 2015 at 11:24 AM 0
Share

Hey, I have noticed something. If I disable CameraOrbit script attached to my cam, and if I rotate my cam manually by its' gizmo, the vectors DO follow cam's rotation in real-time trough the camera view. It seems that this script interferes in some way...

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

20 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

Related Questions

change the length of the vector 1 Answer

Can relative velocity be calculated from relative direction vector 3 Answers

Setting rotation of player equal to rotation of a Line from Line Renderer,Get the rotation of Line Renderer and equal it to the rotation of the player 0 Answers

MoveTowards problem 1 Answer

vertices in current camera view 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