I want to create a little “shield” in front of my player, it will be stationary. Ideally I would like it to be damaged enemy projectiles.
I’ve spent a little time this evening looking at destructible meshes, whilst quite fun, I’m not sure that I can get the level of control I want. I dont want the entire thing to shatter, but I would like one or two pieces to come away each time its hit - I seem to get either utterly destroyed or it just toppling over, or sometimes, its little legs giving way and then it staggering over - all very entertaining but not very useful so far.
An alternative I have considered was to create a complex object via Blueprint, have it spawn a series of static meshes next to each other giving me the shape I want. With this approach I feel that I can get a better handle on collisions, but it doesn’t feel very efficient.
What I’d like to have is something like this;
I’ve put that together in Maya, initially as one combined meshes, but then I saw the FBX chunks options for the destructible mesh approach and separated it all again.
What I would like is for one or more of those little cubes to be affected when hit with a projectile, they can simply disappear, that would be fine, no need for anything really clever…
Any ideas on the best approach for something like this?
hi Rob… it does make sense for each block to be instances of the same basic actor… then you would place them around each level as it suits your design.
You can also make variations of the base actor in color, shape, times it can be hit, particle FX ect. Your base actor would be set up to receive collision events from your ball, projectiles, even fragments of other blocks as they disappear, fade, explode. Your base actor would have a mesh (a block, or anything else), some kind of collision (simple, or complex) either generated by UE4 (good for simple shapes) or more complex built in Max, Maya, Blender.
As part of your base block actor’s collision, when it’s set up right, there is a hit event generated, the signal of which is used to add points, generate particle effects, split up into destructable chunks, speed up the ball, and destroy itself.
Thanks for taking the time to reply.
I would agree and I think this would be my preferred approach, as I’m not really getting anywhere being able to target and destroy a specific bone from the destructible mesh. HOWEVER…
As far as I am aware, there is no easy/manual way to create one Blueprint which has a series of children like the above.
Whilst the functionality is similar, this isn’t for an Arkanoid clone, where I may have the time to manually grab Blueprint instances into the level, this is actually really small and I need four of them, they are the shields/bunkers for Space Invaders.
So what I would want here, ideally, would be one Blueprint that was for the individual block, so that I could add the unique behaviour I wanted, but then have one Blueprint which is the collection of many of those Blueprint actors to create the layout/shape.
As far as I am aware, I cannot add Blueprints to a Blueprint (manually) - this would be Nested Prefabs in Unity, which worked perfectly.
I had the same problem when I wanted to create the formation of Invaders, for that however I was able to simply iterate through two values to represent rows and columns and then “Attached Actor”. I could try something similar for this, but there are several rows where I dont want some to be added, e.g. the gaps in the pattern, which makes the logic for the creation a little bit more challenging. If I could simply go into a new Blueprint and just manually “Attach Actor” (from an existing Blueprint) that would be fantastic, but I don’t think you can.
Any thoughts on this?
Equally, if I were able to target a specific “chunk” for the Destructible Mesh, accurately, so I could remove just one block where ever the enemy project hits, that would work fine too, but I don’t think the Destructible Mesh is the approach that is going to work as it seems too destructive, too many blocks are destroyed each time. It’s a shame, it would have been a straight forward and visually interesting approach.
So, one Blueprint to contain many Blueprints seems to be the only way forward… how to create?
(please be aware that you may get an email notification regarding my reply but if it doesn’t appear here yet its because I’m still being moderated, excessively)
…and then I found…
Unreal was less than keen when it came to compiling the 206 child actor components, but, eventually, after some “oh my goodness me, its crashed, did I save it first” moments… the world seems good again…
I’ve realised a couple of limitations with my approached, for example, I created a “bunker block” Blueprint, set the material, and then went off merrily adding all 206 of those to the main Bunker Blueprint.
They all share the same material, so I can do a quick change of colours which is handy, but I don’t think I’ll be able to easily say “this bunker can be red”, “this bunker can be blue” etc…
Not the end of the world, and I’m guessing I could add a variable to the main Bunker Blueprint and then have it iterate over all the children to set a different material at runtime…
It was kinda painstaking adding all of those child actor components manually, but probably still quicker than thinking out some compex logic to do that at runtime… this will do for now!
I’ve added a quick collision test to the Bunker Block Blueprint to just destroy itself upon collision, dropped the main Bunkers into the game, and they’re working perfectly!
Yes, I haven’t used this approach… but you can assemble several static mesh components (all cubes or a bunch of other shapes) into an actor blueprint (your shield)… giving the individual components collison, hit events, points, particles etc… It’s certainly possible with static meshes, and I think destructable meshes too.
You create the BP Actor, then click to add components (meshes, cameras, simple collision shapes, particles) as part of one assembly that you can add many times into your game level. At this stage, I’d definitely start looking at some of the official training videos, they are a great resource for covering the absolute essentials.
Thanks for the replies. You inspired me to look further through the “Add Component” menu which was where I found the “ChildActorComponent” - worked perfectly
mmm… as for the Invaders… yes you could do them all in one BP with one static mesh component for each in… and move the whole huge single block of actors back and forth together… it’s unusual but in this case there is a weird elegance to it. I don’t think there is any restriction to the number of components to a BP actor.
I haven’t looked at destructable meshes in a while so I can’t really advise. What you’d like is achievable I think, though it would take some study and research. YouTube and Google are excellent for this stuff…
For the invaders I created a Blueprint Actor class which had a BoxCollision and a StaticMesh, along with 3 Scene Components for different firing spawn positions.
Then I created one Blueprint Actor class to act as the InvaderFormation, this took values for rows and columns, iterated through both and spawned an Invader Blueprint actor each time, the end result was 55 invaders all within one Blueprint Actor. This was given a BoxCollision of its own which was used for the horizontal movement, where-as the BoxCollision on each invader was used for the collision with projectiles. Worked well
I’m happy you got it working… well done!