i have spent hours trying to make a brick wall stand up by itself and i guess i’ve finally got it, so i wanted to post in case other people are struggling with this.
i have attached a project, its 4 brick walls, 1st is 2 bricks high, then 4, 8 and 16
the bricks are .25x.1x.1, 1kg, 0 drag and .01 angle drag. the first 2 walls are fine, the taller ones spontaneously collapse.
i found by increasing drag and angle drag to 100 i’m able to get them to stay up.
BUT, i have a big proble, when i hit it with a 5kg, .3m diameter cannon ball traveling at decent speed, it knocks a hole in the wall but doesn’t smash it to bits. i think it should. maybe too much drag but then if drag too low, it will not stand up
maybe there are other ways?
UPDATE
i hacked it i guess by putting a big box collider as a trigger around the whole thing then adding this script to the wall
private bool hitAlready = false;
void OnTriggerEnter()
{
//Debug.Log("ObjectCollision OnCollisionEnter gameObject.name=" + gameObject.name + " collider=" + collision.collider.gameObject.name);
if (!hitAlready)
{
hitAlready = true; // so another collision on an already collided object is ignored
Debug.Log("BrickWall OnCollisionEnter gameObject.name=" + gameObject.name);
Rigidbody[] rbList = GetComponentsInChildren<Rigidbody>();
foreach (Rigidbody rb in rbList)
{
rb.drag = 5;
rb.angularDrag = 1;
}
}
}
I have the same problem,. This Same question is asked in 19 Forums over 12 years. I myself have asked for months,…
NO ANSWERS ANYWHERE> not one single answer, or even a link to a tutorial.
It’s so funny to look at UNITY Marketing and see it says:
“GREAT COMMUNITY SUPPORT”
lt is for to laugh!!
A Wall Staying Asleep until is it COLLIDED WITH? A COMPLEX PROBLEM LIKE THAT!!?!
UNREAL MAKES IT EASY.
AUTODESK INTERACTIVE MAKES IT EASY,
GAME MAKER MAKES IT EASY,
GODOT MAKES IT EASY,
CRYENGINE MAKES IT EASY,
URHO3D MAKES IT EASY,
AMAZON LUMBERYARD MAKES IT EASY,
HELL ‘3D STUDIO’ for DOS (I WORKED IN 30 YEARS AGO) MAKES IT EASY.
BUT NOT UNITY!
THE SILLIEST THING OF ALL? THEIR RIGIDBODY 2D HAS A ‘START ASLEEP’ OPTION BUT NOT THE RIGIDBODY 3D! IT’S INSANE!!!
AND WHAT MAKES IT SO MUCH WORSE??? PEOPLE LIKE YOU, WHO WHEN THEY FIND THE ANSWER, (THOUGH THEY WERE WILLING TO ASK HERE), NEVER COME BACK TO GIVE THE ANSWER FOR OTHERS!
OH I’M JUST LOVIN’ UNITY’S: “GREAT COMMUNITY SUPPORT”
I should do a video series for my thousands of Game and VR Youtube Subscribers, as to “WHY UNITY IS DEAD!” and show the THOUSANDS OF UNANSWERED (SIMPLE) QUESTIONS HERE! HMMM. THAT WOULD AT LEAST BE SATISFYING!!
wow… um, chill man…
2d colliders have a ‘start asleep’ option indeed. You can make your own for 3d colliders i guess.
Activate it only when something happens in its collider, or something like that ?
You actually said it yourself : “A Wall Staying Asleep until is it COLLIDED WITH?”
→ Set “isKinematic” to true, and OnCollisionEnter or whatever, just set it to false…
Never had to do it, but except if this is the main thing in your app/game, i’ll advice you to avoid that, because it’ll probably be laggy. You’ll have a massive drop of fps.
And actually, he did post his solution more than one year ago…
Hope you were sarcastic about your “thousands youtube subscribers” (actually 30).
You could try something like this, swapping the wall out for one made up of bricks and applying an explosive force in the direction of the cannonball. Otherwise, you could set the rigidbodies to “is kinematic” and turn that off once a collision is detected.
Another cool way to do this, is by using triggers together with animation and a bit of scripting.
First: In a 3d modelling application, create a wall, then make an
animation of it being destroyed.
Call the animation, wall destroy animation, or whatever you like.
Next, bring the wall and wall destroy animation into Unity,.
Put a trigger on the wall, that’s programmed or scripted, to make the
wall destroy animation play, whenever the cannonball hits, or touches it.