You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi , is there is anyway to change the mass of all generating piece ?
as I found , the mass of each piece will be 1 as default , I want to decrease the number to something like 0.01 ?
Updated:
thanks , I got the idea , I didnt notice that the pieces are under the main object , I thought it will be " real time rendering "
awesome package
close it ❤️
The text was updated successfully, but these errors were encountered:
change the script to your liking. its all open source as far as i see.
in explodable.cs
in the routine
private void generateFragments()
you can get the rigidbody2d component where he is looping through the created fragments and assign the rigidbody2d values.
or you can write another function to loop through all of them.
`public void fragment(float gravityScaleOfPieces = 0.0f)
{
if (fragments.Count > 0)
{
deleteFragments();
}
//if fragments were not created before runtime then create them now
if (fragments.Count == 0 && allowRuntimeFragmentation)
{
generateFragments();
foreach (GameObject frag in fragments)
{
Rigidbody2D r = frag.GetComponent();
if (r != null)
{
r.gravityScale = gravityScaleOfPieces;
}
frag.transform.parent = transform;
frag.SetActive(false);
}
}
}`
here is what i did to automatically set their gravity so they dont act on their own . I call this when I want to make it exlpode.
Hi , is there is anyway to change the mass of all generating piece ?
as I found , the mass of each piece will be 1 as default , I want to decrease the number to something like 0.01 ?
Updated:
thanks , I got the idea , I didnt notice that the pieces are under the main object , I thought it will be " real time rendering "
awesome package
close it ❤️
The text was updated successfully, but these errors were encountered: