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 niconicx · May 02, 2012 at 07:31 PM · gui3dcollidersmain menu

Is it possible to suspend GUIs after running fade-in scripts?

Hi! I'm new in using unity.

First of all I was looking for some answers here that would also answer my question. but so far i found none. (well i found some but it's still kinda far from what i'm looking for).

here's what i want to happen:

i used a 3D terrain for my main menu. my main menu uses iTweens to navigate the whole 3D terrain (it's like when you click a button the iTween will move the camera and it will bring you to another location of my 3D terrain where another menu is waiting). i saw that kind of menu in youtube but i can't find it anymore (the one that all of his GUIs like the options, name of the character, etc. are all in a 3D Gun since its a FPS game i guess).

i already watched video tutorials about making 3D navigational main menus and it was helpful. but the problem is, a part of my 3D menu needs some GUI textboxes. and as far as i know, GUIs always stick in front of the camera which means it will be all over my menu when i just want it to be in a specific part of my 3D menu.

so i came up with an idea that if i can attach a collider to my camera and another collider(which serves as a trigger) in the place i want the GUI to fade-in and will fade-out if you triggered the collider again so that it won't make any mess. i tried to use some collider scripts and fade-in scripts and tried tweaking those but somehow it didn't work. and now i'm back to zero.

i'm sorry if i can't show you any scripts for now because it's on my groupmates pc and he's on a vacation as of now.. but i want to know if my idea is somehow possible. and if it is.. can someone help me to construct the right concept to make this things work? (i'm having trouble understanding colliders :|)

hope you understand my problem. thanks! :)

Comment
Add comment · Show 2
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 Seth-Bergman · May 02, 2012 at 08:53 PM 0
Share

ins$$anonymous$$d of colliders, you could just use distance. like :

if(Vector3.Distance(cameraPosition, guiPosition1) < some$$anonymous$$inDist) //turn on gui text 1

seems like the trigger idea should work, hard to say what went wrong due to lack of details, but if each object has a collider, with one set to "isTrigger", then using the function OnTriggerEnter should do it..

avatar image niconicx · May 03, 2012 at 05:33 AM 0
Share

i placed a collider on the camera then a collider(trigger) on the place i want the GUIs to show. but it seems i'm having a hard time understanding collider works. (and i don't know why LOL).

can i ask about the guiPosition1? is it the one you place in the Rect()?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by T27M · May 02, 2012 at 09:41 PM

This ? You could just use a bool to show/hide the textbox when you need it.

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 niconicx · May 03, 2012 at 05:27 AM 0
Share

yes! i was about to edit my post and place that link..

anyways i also tried using bool to show/hide the GUIs but it didn't work.. maybe because i'm kinda new to game scripting but i'll try to do it again. i'll update again in case i'll have any troubles

avatar image T27M · May 04, 2012 at 03:35 PM 0
Share

Just put something like ..

if(myBool)

 {

     GUI textbox here
 
 }
avatar image niconicx · May 16, 2012 at 09:33 AM 0
Share

correct me if i'm wrong, here's what i'm trying to do:

in the function OnTriggerEnter(), if my collider is triggered then it will set myBool to True.

Then the "if statement" is under the function OnGui() like the one on your comment above.

am i right?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Using 2D GUIs in a 3D Terrain for a Main Menu 0 Answers

box collider and mesh collider not working 5 Answers

GUI Popup problem…! 1 Answer

Wheel Colliders not colliding with Mesh Collider 0 Answers

Problem with variables 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