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 /
avatar image
0
Question by Ancard · Jun 24, 2017 at 08:48 PM · c#scripting problemmeshscripting beginnercollision detection

How to detect when two colliding objects create a corner?

alt text

Well if you look at the screenshot, I would need that corner to look more like a corner, my idea is to be able to make walls dynamically in game time but without using connectors like the posts of a fence, looking more like a smooth wall. The wall is composed of 3 parts, the two faces that are seen and an upper face for a perspective view, would have a total of 3 planes. I try to detect the face that collides with the panel collider but the script does not work very well. It does not do what I need technically. The idea is that, when I can detect the corner, I can decide what to do with that information. In any case could replace the affected models to close the corner. Also could apply another type of solution, the problem is that, I do not know how to detect that these two objects create a corner.

Edit: alt text alt text

Well, studying the grid topic a little, I realized that this was not going to be useful so I completely redo it. Now each vertex of the grid, each point, is formed by a gameobject which can store information. So far I can say that I store a wall and the points to which it connects. Even so I was thinking that this became very tedious and I do not think it will be useful either, so before going any further, I would like you to give me some tips on this. My idea was that each connected point provides information on whether it has a wall or not and to which points that other point is connected, to know if a corner is created or not. Then I found the possibility of adding another type of wall, such as a fence, but I thought, if the wall was not a wall, and this was a fence, and this was between two walls, I would know if it is a wall or If it is actually a fence. Then I came up with the possibility of adding sub-grids where the walls would really be stored, and I found that I would need a total of 4 grids, one to navigate the poles that create the walls, another 2 for the walls, and another For objects that I will add as a box or barrel, etc. And this leads me to not know if what I'm doing is fine or if I'm complicating it more than it really should be.

walls-corner.jpg (36.1 kB)
walls-corner.jpg (29.1 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 Cherno · Jun 25, 2017 at 01:11 AM 1
Share

Depends on how your wall placement works... If it is freeform and you can place anything anywhere, I can't help you right now. However, if you use some kind of snap-to-grid system, and it looks like this on the screenshot, then you could store the information of a particular grid point when a wall is placed there and use that to compare is with it's neighbors to find out if a wall is perpedicular to it.

avatar image Ancard Cherno · Jun 25, 2017 at 03:08 AM 0
Share

I like it, it's a good idea, thank you !!. Yes, I'm using a grid to place the walls. I think it's seen somewhere, a guide to work with dots and place figures with them. I will investigate about it and apply it. It could also be used to store other types of objects that I place using the grid. Although I will see it later...

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Manpreet_96 · Jun 25, 2017 at 04:42 PM

Well, let's see @Ancard, what could be the easiest way to do this? One suggestion I have is putt Raycast from Top left corner of front wall (I am taking this pic as reference to explain my point) , going all the way down along the edge. And the second Raycast from top right corner of the other wall going all the way down the egde. When the raycast detect a collision, you will know it has formed a corner. This may not be very convincing but it's just a thought. Try to implement it.

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

355 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image

Related Questions

help with enemy health script 2 Answers

How to move the object to where the object is already pointing to? 1 Answer

Character not jumping high enough 1 Answer

Having difficulties making a block be a death trigger for a ball. 2 Answers

How do I destroy a game object my character hit ONLY if a condition is active? 2 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