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 /
This question was closed May 09, 2014 at 03:44 AM by robertbu for the following reason:

Multiple technical questions

avatar image
0
Question by _Bidi_ · May 09, 2014 at 03:17 AM · collisioncolliderlinerenderer

Create a collider for area created by mouse

Hi all, sorry for my poor English, I want to create a game like this

alt text

For example, the requirement is 2 red balls and 2 yellow balls, then the user uses mouse to draw a shape in order to meet the requirement.

My logic is create a collider covered by the drawn line and check the collision with the balls. But I dont know how to make that. I've learn Unity for 1 weeks, please help ^^ All comments is much appreciated. Thanks!

require.png (10.2 kB)
Comment
Add comment · Show 2
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 robertbu · May 09, 2014 at 03:43 AM 0
Share

Unity Answers addresses questions with a single specific issue. Unity Forums is a better fit for high-level design questions like yours.

You have a number of individual technical problems:

  • How to draw a line

  • How to save a path

  • How to detect when a path is closed

  • How to detect what balls are inside the path

In turn each one of the above has a number of technical issues/decisions. Addressing the specific question of building a collider, you can build a mesh using an arbitrary path using this script from the Unity Wiki.

http://wiki.unity3d.com/index.php/Triangulator

A better solution to run through the line segments comparing all balls to each segment. For a ball to be inside the path, the ball must be on the same side of all line segments.

avatar image _Bidi_ · May 09, 2014 at 05:07 AM 0
Share

Thanks for your comment, but now I've drawn path, auto close the path if it not closed. $$anonymous$$y problem now is detect how many balls inside and I think I can check by the collision. However, I dont know how to do that. How to create the collision for the area that created by the closed path. That is my question. Thanks for your consideration.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

20 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

Related Questions

Line Collision Detection for 2D Game 1 Answer

Player Object can hang on the collider forever 0 Answers

Detect collider when same object contains more than on collider 1 Answer

2D:I have a movementController script on my character but it doesn't move forward 0 Answers

How can i create a character like dragon hill game, Digging underground, what collider should i use? 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