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 DEGUEKAS · Mar 14, 2020 at 09:01 PM · shootermesh manipulationmesh-deformation

Destructible Walls

I'm creating a shooter and I want to add to it being able to break the walls like in this video(https://www.youtube.com/watch?v=LsgvrAz4Ip4) or as in Rainbow Six Siege


I've already looked at unity assets and the ones they sell are not what I'm looking for, for example Ultimate Fracturing Destruction, it's very good but it's not what I'm looking for. for these assets to work you need a mesh that is already fractured and when we shoot they activate the rigidbody to the fragment giving the illusion that it is being destroyed. alt text


there is also Nvidia Blast which we have this scena(https://unitylist.com/p/l7c/Destructible-Walls) that uses it but to destroy uses the same mechanism, Nvidia Blast takes care of fragmenting the mesh but to fall activates the rigidbody


alt text


What I want to accomplish would look something like this


alt text alt text


I have come to the conception that if I want to be able to break the wall no matter where I shoot (without using a framentado mesh) it would deform the mesh.


after researching more about cutting the mesh I came in with this video(https://www.youtube.com/watch?v=1UsuZsaUUng&t=1s) but I do not know how to orient it to what I look for would be something like this video where they also cut mesh(https://www.youtube.com/watch?v=4bi3tLzX0Tw)


I thank anyone who wants to help me and explain to me where I could start or what the best way

02columnsedit.jpg (376.4 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Link17x · Mar 14, 2020 at 10:11 PM

So I used Maya to split an object into fragments (very simple, done with a single tool/button, then a few settings to determine how much it should be broken up). I believe Maya requires a license, I have access because I'm a student. But I'm sure there is other software like Blender you could use for free.


Once this is split up, then imported back into Unity, it will be a parent object (the entire object) then it contains X number of child objects (fragments).


The way I did this in the past was by having an interface called IShatter, that would require all objects that implement it to take a force, direction and radius. I set these values in the inspector for each object so some objects would explode more than others i.e. buildings would crumble, whereas benches would go flying into pieces.


     internal interface IShatter
     {
         void Explode(float force, Vector3 direction, float radius);
     }


Then I had a parent gameObject for all of the fragments, this would be activated and apply AddExplosiveForce to all of the fragments.


         public void Explode(float force, Vector3 direction, float radius)
         {
             fragmentsParent.SetActive(true);
             transform.DetachChildren();
             Destroy(gameObject);
 
             foreach (var fragment in m_Fragments)
             {
                 fragment.GetComponent<Rigidbody>().AddExplosionForce(force, direction, radius);
             }
         }


This is slightly different from what you want because I used very small objects i.e. park benches etc. But I'm sure you could use a similar approach where you have an empty parent object, which contains individual fragments to form an entire object. Then cause some sort of explosive force on each fragment when it is hit by a specific gameObject with a tag i.e. "bullet", otherwise return early so it doesn't explode from the player walking into them or something.


You might notice that I used transform.DetachChildren(); which is so the individual fragment is treated separately from the rest of the gameObject once it is 'hit'.

Comment
Add comment · Show 5 · 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 DEGUEKAS · Mar 14, 2020 at 11:22 PM 0
Share

thank you very much, if in blender it is called Cell Fracture and autodesk this RayFire that is paid but the fragments of the mesh are very large and if I leave them very small and I integrate them into a map would consume a lot.


recently PUBG added a very good destruction system: https://youtu.be/jT1VkCfvJNY?t=21
I'd like where you shoot exactly the circle of the bullet

avatar image Link17x DEGUEKAS · Mar 15, 2020 at 07:43 AM 0
Share

Another technique I belive games like COD often use is to add/replace textures to the position that was shot.


Check out this video https://youtu.be/s0AhTPwe8fo it could be more of the approach you want to take?

avatar image DEGUEKAS Link17x · Mar 15, 2020 at 01:44 PM 0
Share

yes but can you paint a texture with transparency? what I want to do is i can break the walls

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

124 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

Related Questions

cloning prosedural mesh,deform mesh and instantiate 0 Answers

Get plain coordinates for another object 2 Answers

Moving an hole in a plane 0 Answers

How can I change the thickness of a torus? 1 Answer

Sort a list based on edge connections 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