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
0
Question by lborland · Mar 29, 2016 at 10:57 AM · 2d gamelinerendererconnectrestrictions

Line Rendering for 2D Connect the Dots Game

Hi I'm new to Unity and have a question about restricting the player's ability to draw lines while playing this game.

My 2D game involves the player drawing lines between pairs of dots in a grid of provided dots. I only want the player to be able to draw lines between two dots but no where else on the screen.

I've made the dots into game objects and added circle colliders to them so I could use OnMouseDown() in the Dots script, to enable my DrawLines script that allows the player to draw lines with the 2D line renderer when Unity detects the player has clicked on a dot. I've got the line rendering down but still the player can also draw anywhere else on the screen :( (I think my problem is that I can't visualize when and in which script to disable the DrawLines script.)

How can I restrict the player's line drawing only from dot to dot?

Comment
Add comment · Show 4
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 ComradeVanti · Mar 29, 2016 at 11:16 AM 0
Share

Which exact procidure do you want?

1.

Player clicks dot1

Linerenderer is created (Goes from dot1 to mouse)

player moves mouse to dot2 (line follows)

player clicks dot2

line snapps to dot2

2.

Player clicks dot1

Player clicks dot2

Line is created already connecting the two points.

3. Other

Please specify :)

avatar image zsolti · Jul 18, 2016 at 01:28 PM 0
Share

First ,Please :D

avatar image magister_yoda_ · Sep 08, 2017 at 05:55 PM 0
Share

Hello. I also want to create a game of such type (dots connection 2d) . But I newby in Unity and I don't know from what I have to start? Couldn't you please say me, from what to start to create such game? On what I have to pay attention firstly?

avatar image magister_yoda_ magister_yoda_ · Sep 08, 2017 at 06:17 PM 0
Share

@Brullix3000 , please look at my comment above

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by nebushaa · Oct 25, 2017 at 07:54 PM

Has anyone of you by any chance done the first procedure please .. @Brullix3000 , @magister_yoda_ and @zsolti .

1. Player clicks dot1 Linerenderer is created (Goes from dot1 to mouse) player moves mouse to dot2 (line follows) player clicks dot2 line snapps to dot2

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

7 People are following this question.

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

Related Questions

Problems with my 2d Topdown game. 1 Answer

How do I make a laser that bounces around a room? 0 Answers

Moving dotted guide line 0 Answers

2D Orthographic Cameras and Line/Trail Renderers Not Working (with detailed example) 1 Answer

Can't get a smooth following line 1 Answer


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