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 Find_1t · Feb 12, 2013 at 10:18 PM · bulletwallspenetration

How to simulate bullet penetrating a cube?

Hello, How exactly will I go about to create simulation in which a bullet (with huge velocity) penetrates through a "wall's bricks" (cube or a lot of cubes stacked together)? The bullet may or may not go completely through the wall's bricks. Thanks

Comment
Add comment · Show 5
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 flaviusxvii · Feb 12, 2013 at 10:23 PM 0
Share

Even though it's just a couple of sentences this is an ENOR$$anonymous$$OUS question in terms of scope and ambiguity. Please be more specific.

avatar image Find_1t · Feb 12, 2013 at 10:32 PM 0
Share

Forgive me for sounding ambiguous. I wish to replicate a real life bullet being shot through a wall as realistically as possible. What I am envisioning is this: attach a rigid body component to a bullet mesh, give it an initial velocity towards a wall (for starters, just a cube), and make it "breakthrough" the wall; that is, it should leave a small hole in the wall, be deflected a bit, and at the end be stuck in the middle or somewhere inside the wall's model. I hope this helps clarify what I am ai$$anonymous$$g for. If I figure out how to do it with one bullet, I will replicate it so as to have multiple bullet being shot at that wall and penetrating it as I described above.

avatar image Lockstep · Feb 12, 2013 at 11:22 PM 0
Share

For leaving a hole you can either Instantiate a small plane with a texture on it. If you really want to create a hole and not only make it look like, you would to have to alter the mesh during runtime which is quite advanced. For deflection you could go with snell's law calculating the new velocity from the old one and the mesh's normal. The slowing effect would be the most simple. All you have to do is reducing the bullet's velocity as long it is inside of the cube.

avatar image Find_1t · Feb 14, 2013 at 05:07 PM 0
Share

Thank you for your reply. How would you suggest I go on about altering the mesh during runtime? I wish to simulate an actual hole not just texture.

avatar image iwaldrop · Feb 14, 2013 at 07:11 PM 0
Share

Checkout this post. Also, checkout object.$$anonymous$$esh. But be warned, altering meshes at runtime is not for the feint of heart.

Additionally, I'd recommend you go with the Find_1t's suggestion of simply placing a 'decal' where the bullet hit. You could use a single triangle (3 verts and one poly) to map the texture on and it would be a lot cheaper than adding several new verts and possibly losing your batching ability on those objects.

You could still simulate what would happen to the bullet like whether it would penetrate and still do damage on the other side or whatever else.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dubbreak · Feb 14, 2013 at 07:37 PM

Megafiers has some physics based modifiers they are adding. I didn't see anything like this, but you could touch base with them.

Covering how to do it yourself is beyond what can be answered here. What you are asking is beyond plenty of people with compsci degrees. It's huge. I mean even defining the materials so you can calulate how it's deformed and destroyed is a big task (and I assume would take some physics background.. my one uni physics course is failing me on what variables would be needed). I'd also be worried about performance (though since I'm not sure on how bad the calculations are it might be fine especially if you aren't dealing with too many vertices).

My question is: Why do you want to do this?

With the blocks and the suggestion Lockstep made you can have a pretty realistic physics simulation and just take on a texture (like ultimate fps does) and it's good enough for games. If we know more about why you want to simulate and actual hole then maybe you can be pointed in a better direction.

If what you really want is to do physics simulation, then there is other software more suited to it than Unity that should take care of most of it for you.

Comment
Add comment · Show 4 · 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 Find_1t · Feb 14, 2013 at 08:11 PM 0
Share

The reason I am doing this is that I wish to know to what extent I can push the accuracy and performance tradeoff that differentiates video game development from scientific simulations. Basically how accurate can we get while still getting a reasonable visual simulation.

avatar image dubbreak · Feb 14, 2013 at 08:34 PM 0
Share

Real time simulation? You can always use unity to visualize data from other sources.

avatar image Find_1t · Feb 14, 2013 at 08:39 PM 0
Share

That's was what I had in $$anonymous$$d from the beginning. I just wanted to know whether unity could assist in the simulation by simulating the less important parts. From the looks of it, it doesn't seem very likely.

avatar image dubbreak · Feb 14, 2013 at 09:05 PM 0
Share

Well it's doable, just not without writing code. A lot of code. $$anonymous$$aybe someone else will pitch in with something more. Though you could contact the guy who wrote megafiers to see what he thinks of simulating what you're trying.

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

13 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

Related Questions

Penetration weapon needs to find all objects it passes through 1 Answer

Bullet Penetration 1 Answer

Simple Raycast Penetration 1 Answer

How to Create Bullet 2D 0 Answers

Pretty simple problem: Bullet hole spawn wrong 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