# learning to make a dynamic destruction system

so far i already researched about using the mesh and mesh renderer class so far i got it to where is i shoot at a cube for example i recreate it using the mesh class but i can’t seem to think of a way of recreating it broken, anyone has any advice or something to guide me about it? i’m aware that there are systems already on the asset store, i choose this more of a way to improve my skill and i want a more improved solution. would it be bad trying to create such system on unity dynamically or should i just try using a third party solution such as Apex from Phisx?

another thing it seems that i can’t get enough info when using a raycast for example i tried using the point where it hits and randomly create 3 more vectors around the area to create a hole to start out, now i need to figure out how would i make the mesh with those random vectors making a hole for example.

SIlly programmer trying to make art the hard way…

; )

there are a lot of ways to create random directional vectors

think of it like this…you have you initial direction right?

That is a vector, which is nothing more than a delta from a given point in x y z space

A unit vector is a vector that has a length of exactly one.

All you need to do is rotate that vector by a random amount.

This is a great excersise for you because learning vectors is an essential first step in learning 3D Matrices which is an essential step in learning to code in 3D.

Study vector math and vector tranformations and you will have your answer!

hi about what you said into learning vector math, transformations and 3d matrices do you know or have any good places i can go for it besides google lol?

That’d just be one example. There are, quite naturally, plenty of regular mathmatics sources, both online and in the shape of books.

Dynamic shattering is definately a non-trivial issue, and I personally suggest using preshattering where possible. Dynamic shattering can certainly be done in Unity, but it requires a relatively comprehensive understanding of 3d mesh manipulation.
If you ‘simply’ want to cut a hole into the mesh, as suggested in the last part of your post, I’d suggest looking into boolean operations on meshes. Once again though, this is hardly trivial.

thanks for your input, yes i know i sound like a total idiot trying to tacle something out of place, i’m at the point in which i still considered my self intermediate, still trying to move up to advanced lol