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 Aj8841 · Oct 12, 2021 at 08:53 PM · c# tutorial

How can I recreate tank spalling in my game?

Hello all,

Today, an idea sparked into my mind and I wanted to create a tank simulator similar to War Thunder. I have already started out with the Physics Tank Maker asset from the asset store, but there is one thing that I can't seem to get.

In games like War Thunder, there isn't a HP system or Hit Points. There are modules (like engines and crew members) that you have to destroy to knock out a tank. And the way it happens is when the bullet hits the armor, it will break up into bits and pieces called spall or shrapnel. These hunks of metal are what actually do the damage to the insides of the tank(if the bullet was able to go through the armor). I found this YouTube video showing a simulation of a bullet going through armor:

https://www.youtube.com/watch?v=_1sNSBQdiBo

The problem is I don't know how to implement this to my game. Should I use unity's physics engine or raycast? And how would I?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by SamElTerrible · Oct 13, 2021 at 01:11 PM

Having shrapnel fly around inside the tank to determine how damage is dealt to the inside seems overcomplicated for a game. What I would do is have different colliders on the outside of the tank; and each collider is mapped to an inside element of the tank. E.g. if you hit the collider at the back of the tank, the engine will be damaged, and if you hit the collider around the middle it will hit a crew member.

Comment
Add comment · Show 3 · 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 Aj8841 · Oct 14, 2021 at 02:21 AM 0
Share

Okay, I like that idea.

"Having shrapnel fly around inside the tank to deter$$anonymous$$e how damage is dealt to the inside seems overcomplicated for a game."

I don't think I really agree with that. I don't think it is over complicated, I think it is just more difficult. Having Colliders all around the tank wouldn't be that realistic. If I were to shoot the tank from the front, I would only kill the driver or assistant driver. In real life, if I were to penetrate the frontal armor, it the spall/fragmentation would create a shotgun like effect that would destroy/kill everything it hits.

So I was thinking about making a raycast "shotgun" script that would activate when the bullet penetrates. OR use a particles to simulate the spall/fragmentation.

I am trying out the particle system, I got it to somewhat work. But I need the particles to remove child objects. But I can't seem to get it to work.

avatar image SamElTerrible Aj8841 · Oct 14, 2021 at 08:27 AM 0
Share

Totally agree with this:

Colliders all around the tank wouldn't be that realistic

By overcomplicated I meant in terms of scalability. As a developer I normally have to think about ways to 'fake' different effects in order for my project to be optimised.

Of course, having particles with colliders inside tanks would be the most realistic approach (and its a pretty good idea in my opinion). However, its one thing to have just one tank working like this on your PC. Its another thing having several tanks spawning particles which detect several collisions per frame running on a low end Android phone.

I guess it depends on where you want to go with your project. But if you opt for the particle solution, I know you can set your particles to detect collisions on the emitter. Once you have collisions detected then you can do pretty much anything with that information.

avatar image Aj8841 SamElTerrible · Oct 16, 2021 at 02:52 AM 0
Share

"As a developer I normally have to think about ways to 'fake' different effects in order for my project to be optimised."

Well, even though we all try to fake stuff like bullet ballistics. I feel (this is just my opinion) that it sometimes takes longer than just simulating in real-time. And, I also feel a bit tired of those colliders on the side of the tank with some RNG to calculate the damage/hp etc.

So, changing the subject. I encountered an issue: It doesn't seem like child objects can detect or be detected in collisions. And this is an issue because my hierarchy is like:

  • Main_Body
    - Driver
    -Assistant Driver
    -Turret
    -Gunner
    -Commander
    -Loader
    -etc

...and all of the child objects (like crew members) aren't being detected. Is there any way I can make it so that they can be collided and detected with?

avatar image
0

Answer by Aj8841 · Apr 12 at 11:54 PM

I think I might have got somewhere:

I took a break for awhile and landed upon Gunner Heat PC on youtube and it inspired me once again.

So i looked up a bullet penetration tutorial on youtube, implemented it, then added a shotgun thing to it so the shotgun pellets would be the spall fragments. I was able to simulate HEAT and AP rounds, but as of right now, you can only see the damage in the editor.

Here is my result: https://youtu.be/BVoMwAx9LqE

code download (github): https://github.com/XSnipinblazeX/TankSpalling

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

127 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

Related Questions

UI text script error 2 Answers

How do I change the speed at which the slider moves? 5 Answers

GameObject not being recognized 1 Answer

How to adress a Transform inside a arraylist that's inside a arraylist. 1 Answer

c# camera PropertyDialog() 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