I have a very simple game that has some fun with a destructible object, physics, and slow motion. You can make it explode into tiny pieces, but I wanted to throw something else in there.
Is there some way to get a “Black Hole” effect that will try to suck all the little bits into one point, then explode them all out again?
I’d like to be able to hit a button (like R for example) and have all the parts in the area come in and explode after a short amount of time. I tried using a radial force component in my blueprint and setting the impulse and force strength values to a negative number, but that didn’t do anything.
In this image you can see how I’ve set up the blueprint so that it activates the radial force actor > delays a bit > then deactivates it before moving on to the next one.
The first radial force will pull in the destructible mesh then after the delay will activate the second one to cause the explosion you see.
Do take note that this example I was using this on a specific mesh inside my BP. However, you could just have the radial forces in the BP and with the same setup. That way it’s not just the specific mesh it’s affecting. It could affect other destrucibles that are around your scene.
If it’s not too much to ask, I have ran into another issue(s).
Firstly, I can’t have too many cubes on the screen at one time. The game is an Oculus Rift game, so the framerate needs to be 60-75 fps at all times. I’ve added the destroy function to my game blueprint, and made the target the cube. I also have a function set up to spawn more destructible cubes at a certain point, and I linked that outcome to the destroy function at a button press. It works, but let’s say we have the origin cube that starts when the game begins, and 2 spawned cubes. They all collide, and explode apart. If I press the destroy key, it destroys all the pieces of the origin cube, and the second spawned cube, but not the first spawned one.
QUICK EDIT: The slowdown in the video is a slowmotion effect I implemented, not the framerate dropping.
I can’t figure out how to get the delete function to delete ALL of the destroyed cubes in the scene at once. Also, no matter how many times I press the destroy key, it won’t destroy the leftovers.
I have another question.
I’d also like to get a pause feature going, but only one that pauses everything BUT the player. So, the exploded cubes would freeze, and the player can freely move around them, then press a key to unpause, letting the cubes continue exploding like they were before, as if they hadn’t been stopped. I don’t really know where to start with this one honestly. I’m quite new to Unreal Engine (as in, I’ve only used it for a few months) and I’m only just now really getting into the nitty-gritty of it. Think you could give me a hand with this as well?
I’m not exactly sure how to go about setting that up for the Pause and keep the player moving. I’ve spend a little bit of time this morning playing with Time Dilation to get things to slow down and speed up (which is quite fun!!).
Take a look at these to get you started. Hopefully someone with some Blueprint wizardry will be able to pop in with a way to pause and still move. I will continue to look at this but not sure if it’s completely possible without going into C++ code for something.
As a side note with Time Dilation node: setting it to 0 will not stop time. Setting it as low as possible will, like 0.01, but it won’t completely stop.
With the spawning problem I’ll continue to look at that and see if I can get your clearer answer. There should be a way to do it, but it may require some toggling of things inside the BP to make it work.
I’m not 100% on this, but it may require having the destructible in its BP to have collision, visibility, and some other things disabled until you spawn it then toggle them on.
Give this stuff a shot and let me know how it goes! You’ve got a fairly fun project here!