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 gordeszkakerek · Apr 17, 2014 at 09:49 AM · androidraycastobjecttouchdestroy

Android touch 3d Object event

I have 2 cube Object on my android screen. Cube1 and Cube2. I will make this: if I touch on screen Cube1, then destroy Cube1. If I touch on screen Cube2, then destroy Cube2. I searched a lot, but trying on yet unfortunately failed.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Tasmia · Apr 17, 2014 at 09:58 AM

void OnMouseDown() {Destroy(gameObject);}

also works for iPhone and android ... I have tested on devices and simulators

Comment
Add comment · Show 4 · 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 gordeszkakerek · Apr 17, 2014 at 12:48 PM -1
Share

I have unity 3.4. maybe therefore does'nt work this?...unfortunately...but thanks for your answer!

Sorry I cant yet up vote, still do not have the authority to do this.

Any other ideas?

I have unity3.4 because I learned the older unity java scripting, and I have no time and energy to learn the new sripting.

avatar image Benproductions1 gordeszkakerek · Apr 17, 2014 at 12:48 PM 0
Share

Please post comments as comments not as answers

avatar image Benproductions1 · Apr 17, 2014 at 01:08 PM 0
Share

@gordeszkakerek Um... UnityScript hasn't changed one bit since I started using Unity, around version 3.4

avatar image Tasmia · Apr 18, 2014 at 07:29 AM 0
Share

http://answers.unity3d.com/questions/205953/finger-tap-ins$$anonymous$$d-of-mouse-click.html

I hope this may help you :)

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

22 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

Related Questions

i need help in walking character in android, using raycast where user touches? 0 Answers

Destroying GameController Respawns? 0 Answers

Destroying object using his name and raycast 2 Answers

Moving object away from newly created object created by script 0 Answers

When I touch one object all others react 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