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 somanas · Sep 04, 2012 at 07:12 AM · mouseclick

Remove a part of image on mouse click ?

I am making a cake pop party type of game. And need to eat the saved textures piece by piece. just want to know how to implement this feature. clicking on the image removes a part of image where the mouse clicked. I am stuck and any direction in this regard would be helpul.

thanks in advance.

Comment
Add comment · Show 5
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 AlucardJay · Sep 04, 2012 at 07:32 AM 0
Share

I havn't seen this game, can you provide screenshot? At a guess, your 'cake' will actually be several pieces arranged to look like one cake object, and each piece would have 2 textures, one for uneaten and one for eaten. Then when you click on a part of the 'cake', it knows which piece is chosen, and if it is eaten or not.

avatar image Anusha · Sep 04, 2012 at 07:34 AM 0
Share

http://www.youtube.com/watch?v=uD5qZWe6qyw

check this link...

avatar image Fattie · Sep 04, 2012 at 07:38 AM 0
Share

suggest you read the easily-available unity documentation for "Input" dealing with mouse clicks and so on. You can work on it from there !

avatar image somanas · Sep 04, 2012 at 07:53 AM 0
Share

is there masking possible in this context..?? I think i would have 2 use masking as the eating is very random process..

avatar image Fattie · Sep 04, 2012 at 07:56 AM 0
Share

masking? I don't know what you mean but I urge you to read about and start using simple functions like this

http://docs.unity3d.com/Documentation/ScriptReference/Input.Get$$anonymous$$ouseButtonDown.html

and this

http://docs.unity3d.com/Documentation/ScriptReference/Input-mousePosition.html

good luck !

1 Reply

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

Answer by Anusha · Sep 04, 2012 at 07:33 AM

clicking on the image removes a part of image where the mouse clicked.- this is what u want to do?

well u need to picture ur cake as a puzzle.all the pieces assembled together. U will have to create separate bite pieces and place them together so that it looks like a whole cake.. then if the piece is clicked, destroy it..

Comment
Add comment · Show 8 · 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 somanas · Sep 04, 2012 at 07:44 AM 0
Share

Thanks for the valuable advice.. I,m trying to do it like getting the pixels on an area where the mouse is clicked.and then remove it.. Am i on the right track..??

avatar image Fattie · Sep 04, 2012 at 07:55 AM 0
Share

if i understand what you're saying that is quite advanced. you'll have to look in to this:

http://docs.unity3d.com/Documentation/ScriptReference/RaycastHit-textureCoord.html

it's very much more likely that you will just have individual objects, each with their own collider. when the collider is touched, delete it.

I urge you to learn a little but about colliders and start building scenes with objects and colliders!

avatar image somanas · Sep 04, 2012 at 08:01 AM 0
Share

Thanks Fattie , i think this would help... i would try that....!!

avatar image Fattie · Sep 04, 2012 at 08:03 AM 0
Share

good luck, be sure to start a new queston for any new specific questions that arise!

avatar image Anusha · Sep 04, 2012 at 08:30 AM 0
Share

@somanas.. accept the answer if it was help full

Show more comments

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

10 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

Related Questions

Click Point From Raycasting Not Yielding Expected Coordinates 1 Answer

mouse enter Click problem 0 Answers

Can I buy Grid Framework? 0 Answers

Create gameobject on mouse click? 1 Answer

How to highlight a box in a grid on mouse hover, action whenever clicked 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