Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Warbeard · Dec 08, 2014 at 06:08 PM · buttonguitextureinterface

GUITexture not corresponding with position

Hello guys!

I have a slight but annoying issue I hope you can help me with. Basically I am trying to make some GUITexture-buttons for my game, to appear at the end of a round - the standard "play again" v "return to menu" stuff. The buttons work, I guess, but the area in which I need to click is not on the texture itself, but completely to the left of it! Even stranger, the more I move the GUITexture to the left, the more 'accurate' it becomes.

my code is a very simple (pseudocode:)

 function OnMouseUp(){
 //return to menu
 }

...and the GUIbuttons with the same code work in the main menu, just not in my game-scene. Can anyone help?

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 NoseKills · Dec 08, 2014 at 06:27 PM 0
Share

Seeing the On$$anonymous$$ouseUp function doesn't help much when the problem clearly is that it's not getting called when it should. We'd have to see how your buttons are made to be able to help.

avatar image Warbeard · Dec 09, 2014 at 09:15 AM 0
Share

Hello, thanks for replying. $$anonymous$$y question was blocked the first time when I just referenced the On$$anonymous$$ouseUp in passing, so I thought it might be against the rules to not have it in code.

I import the texture. With that texture highlighted I create a new guiTexture. I place it in the scene, attach the script, and turn visibility off. When the player dies the visibility is turned back on, and the button's clickable area is outside the button. I've tried a myriad of positions, and also without the visibility-functionality, it still doesn't work. Is that what you meant?

PS: It's a 2D game, dunno if that has any meaning, but as I said, the buttons work fine in the other scene, so I guess not, but there it is.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Warbeard · Dec 12, 2014 at 07:29 AM

I think I got it fixed - the issue was, I think, that the camera for some reason had its viewport width set to 0.7. This was not so in the menu scene where the buttons did work, and after correcting it the buttons seem to be working as intended! Hope this helps someone else out there!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

4.6 UI callback variable 1 Answer

"The name does not exist in the current context" error 1 Answer

how to check if touching an guitexture android 0 Answers

Graphics Raycaster - Click on overlapped buttons 1 Answer

Tic Tac Toe beginner 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