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 Danboe2009 · Jul 24, 2012 at 06:53 PM · touchscreenjavamiddle

Trying to draw a tongue on screen using touch.

I am making a game where the main character uses his tongue to gather things. So I need to figure out how to let the user click on the screen with their finger and have a tongue appears from the middle of the screen to the place the player touched. Does anyone have any ideas?

Comment
Add comment · Show 1
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 perchik · Jul 24, 2012 at 07:00 PM 0
Share

The key word here is that you said "I need to figure out how to..." and yes. yes you do.

1 Reply

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

Answer by Thom Denick · Jul 24, 2012 at 07:37 PM

This is not a particularly difficult task, but you need to understand the basics of Unity, and in particular object movement and raycasts.

If you don't understand what i'm talking about below, get started by walking through the Unity tutorials on the Unity site.

  1. Create a vertically scalable tongue object. There are a number of different ways you can do this. Either by stacking several game objects on top of each other or have a gameobject that looks ok when stretched massively vertically.

  2. Listen for mouse clicks in an Update. When a mouse is clicked move the end of your stretchable game object to the mouse x,y point. Fancy it up with animation.

  3. Put some kind of collider on the end of the tongue, if this collider hits an edible object, handle it how you want in your game.

This is not an easy gameplay mechanic to implement for someone brand new to Unity. You need to know a lot about Unity. I recommend starting here: http://unity3d.com/support/resources/tutorials/

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 Danboe2009 · Jul 24, 2012 at 08:47 PM 0
Share

will this work for a touch screen game too or just mouse?

avatar image Thom Denick · Jul 24, 2012 at 09:29 PM 0
Share

For Touch Input, you'll want to use Raycasts from touches. You can find out more about how to do that here: http://answers.unity3d.com/questions/222121/raycast-from-player-to-touch-point.html?sort=oldest

avatar image AndyNeoman · Mar 07, 2015 at 10:47 AM 0
Share

how do you move the end of your stretchable game object to the x y mouse position?

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Touch.position, Touch.deltaPosition, Screen.width, Screen.Height 1 Answer

Exporting to Touch Screen Monitors or Touch Screen Displays 0 Answers

Input.GetTouch(0) doesn't work 2 Answers

Different touches on screen 1 Answer

Problem with touch and ui button 5 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