Hello, wasn’t sure how to name this, as it’s two questions… but here you go:
What I’m trying to create with this blueprint is a a dynamic cave in. I’ve set it up to awaken physics objects (the rocks that will cave in) through a trigger. That all works… What I need to know how to do is make it a 1 in 5 chance of it caving in, keeping some dynamics to it. I’m not sure if it would be something like an “if” statement
The flow chart would look something like this if I’m correct…
randomize a number between 1-5(or 0-1, and I’d just use decimals instead)
If randomized number =<1 (or 0.20) then
Wake Rigid Body
I’m a little bit new to blueprints, but I’ve done a bit of kismet before this… So i’m sure there’s a simple way to do this, I just don’t know how.
How would I make an event that would need 2 separate triggers to be activated.
I’m trying to make sticks that hold up rocks, and the player can then go up to those sticks (one on each side) and press “use” to knock them down. Each would trigger a matinee animation, throwing them on the floor… But I need the rigid body to awaken only when both have been activated. Again, probably something simple.
Thanks! LOVE this engine.
Ahh, Figured out the first question… I just used a multigate, and then made a bool random. Here’s what it looks like for anyone else that needs it:
I used Begin Play, and Print String to debug. So just replace those with what you need to do :3
I’d still very much appreciate help on the second question though.
A simpler way to have a 1 in 5 chance of triggering your rock fall would look like:
For 2 conditions you can use an AND node:
Or if you need a specific fail out for each condition, use 2 branches with the true from the first branch to the input of the second branch:
In this either of these, Rama suggestion of an int counter that increments every time a stick is removed is probably best. then just test it against a desired value like I’ve don above with the < signs.
“How would I make an event that would need 2 separate triggers to be activated.”
- in the blueprint that does the actual physics cave in,
you can add a uint8 variable called RequiredCount;
Each time the “do the collapse” is triggered, it checks whether RequiredCount >= 2
the sticks, wherever they are running their code, can call on the Cave In Blueprint and increment RequiredCount, and ATTEMPT to run “Do the Cave In”
in this way it wont matter the order the player chooses, whichever stick is last will successfully run the cave in