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 /
  • Help Room /
avatar image
1
Question by Lichemperor · Mar 14, 2016 at 09:13 AM · raycastrendertexturemousepositionui imageminimap

How can I get the click position on a Rawimage ui element?

So I have a world space canvas acting as a minimap. This is a rawimage using a render texture. I want to draw a raycast from the camera rendering to the texture.

I managed to find this: http://answers.unity3d.com/questions/1018336/is-there-a-way-to-click-on-a-render-texture-to-sel.html

This works perfectly well... for non UI objects. I've been trying in vain for several hours to get the same method working on my UI using EventSystem.current.RaycastAll and a List.

Any help at all will be appreciated. This one is driving me a bit nuts!

Comment
Add comment · Show 7
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 unitynoob24 · Apr 07, 2018 at 07:14 PM 0
Share

Hello! I recently began looking to do the same thing! And I too need this to work in my UI on a raw image / render texture. I have it working perfectly with non-UI just like you and I even used the same source you did! lol

Here is my thread on the Unity forums: https://forum.unity.com/threads/$$anonymous$$imap-help.525486/

I was wondering if you ever found a solution because this is also driving me crazy!

Thanks man!

avatar image Lichemperor unitynoob24 · Apr 07, 2018 at 08:26 PM 0
Share

Hello, I'm sorry I never answered my own question (I hate it when people do that, too!) but I DID find a solution to my problem. Unfortunately I can't quite recall what I did it was so long ago, but I'll certainly take a look when I get chance. If you like, I could share the project files too and see if that helps you. I have a hunch on how I fixed it, but I'll let you know.

Could you tell me exactly what problem you are having? I seem to recall having an issue where the coordinates came back as 0,0 regardless of where the mouse click raycasted to on the surface. is this similar to your problem?

$$anonymous$$aintain hope! It is possible! =P

avatar image unitynoob24 Lichemperor · Apr 07, 2018 at 08:32 PM 0
Share

Yes! :D

That was one of my many issues trying to click the Raw Image I would only ever get (0.0,0.0) so I gave up on that approach. I have tried it at least a dozen ways in the last 24 hours.

But I'm still back at square one. It works flawlessly when I project the orthographic camera to a 3d plane. But when I project it to my Raw Image it dies.. lol and I can't get it to do anything.

Sharing the project would be fantastic!

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

array of raycasts in grid based game 0 Answers

Inconsistent raycast update 0 Answers

How do I draw a raycast with my mouse position that is relative to the main camera? 0 Answers

Picture frame around minimap 0 Answers

assigning several positions and call array of raycasts 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