samfred2 commited on
Commit
4b35f7a
·
verified ·
1 Parent(s): 973e351

[flow_default] Transcription: 009 Don't Crash! Adding collision and a death state.json

Browse files
transcriptions/009 Don't Crash! Adding collision and a death state.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "audio_file": "009 Don't Crash! Adding collision and a death state.wav",
3
+ "text": "So to demonstrate collision and how we can add a death state to a game I'm actually going to add one more asset all the way over here. Now I'm going to go to my game or go to my content drawer and I am going to meshes and as you can see I have this tower mesh. Now before I open this, I want to make sure that I can set this so that when you collide with these towers, instead of just stopping or having some other interaction, I want to create a death state. The way I'm going to do this is I'm actually going to create a blueprint again in the Blueprints folder. This one's going to just be an actor blueprint just like the BP point ring. Awesome. Create the building. Now open it up and inside I'm going to create a static mesh. Pull it over the scene root, rename it to building. And then I'm gonna add to that static mesh. See if I have buildings. this. Now I could do it manually like I did for the point ring, but that seems a bit difficult and a bit unnecessary. Luckily, there are some default and automatic ways with Unreal that you can do this without having to do any expansion or scaling or moving up boxes. So I'm gonna go to collision and collision preset, there's fine. This is fine, awesome. Generate overlap events, great. Now, okay, so what we're gonna do. We're gonna open up the static mesh. Now we're gonna go to collision, type in auto convex collision. We can use the basics, I mean apply. And we see that it has automatically generated collision boxes around much of the skyscraper. Now, you will notice that it isn't perfect and there are areas over here that have sort of gotten overcome even though they are empty empty and we can make that better by adding some more holes So if I actually go 8 Beautiful you can see that now that area is a little bit less cluttered and I can mess around with these settings for a few little minutes But I think this is good enough for now. So we're gonna leave this as it is. Go back to the BP buildings. Awesome. Naval gravity is good. Actually I'm gonna turn the gravity off. And I am gonna simulate physics. Now collision, yes. Yes, this is all good. This needs to be overlap all. Awesome. Now, we can add another on overlap event to this item. And in it, we can create a def event. So I can do this to BP underscore flying pond. And then as that I can now we're actually going to have to go to flying pond and create this event graph. Create a new HUD, not really a HUD I guess, a new UI that shows that we've died and allows us to respawn. So the first thing we're gonna need to do is actually create that UI. Now I'm actually going to head back to minimal default and create one more blueprint, the last blueprint. Another user interface. Widget.create. Bp underscore death screen. Open this up. And the first thing we're going to add is actually a button. Excuse me, not a button. An image. I'm going to drag this out. This is going to be the background of our death screen. Now if we go to an image, brush, and we pick a good image. Now I'm actually going to do this through the content drawer because in images I've put together a nice background for you guys to use. So we're going to put that there. And then we're also going to put together a text box would be good, right? Just go there. You can also increase the text size a little bit. Font size 240. But better, you can expand this box here. You crashed. Oh no. Now let's add a button below it. Make it a bit bigger. And in that button, let's add another horizontal box. Right there. And in that horizontal box, we'll add an image and text. Awesome. So we have this image first and the text. Let's go to the image. We can select this image. Now we're also going to have to hit fill, I believe. And we're also going to have better. And then on this text, let's change it to Respawn. Let's also center that as well. This one. Awesome. And then let's just add. No. This is the cheap way of doing things. Don't do this. It's a bad way of doing it. No. I'm actually just going to get rid of this text. And add 10. This is giving me more space around my image. And then we can make this color blue. That's the foreground color. Excuse me background color. Nice blue. That should be fine. Interesting. Alright, now we have this death screen. Doesn't look super pretty but it will do for now. And this is a design for you guys to really take it and run with it and make it as beautiful as you so desire. So let me do that. Do that. Awesome. Now if I go back to my flying pond on death I can create widget and we can select my death screen and then we can attach it to the viewport. Add to viewport. Awesome. Before this, I'm actually going to destroy the actor so This is not necessarily the proper way to do things but it does work I forgot to actually place it in let's add a. Right over here. All right, good to know. So this is working. I see we're not calling the event because we haven't created it yet. We haven't created it yet before. And so we weren't able to cast to it. Death. Boom. Almost there. Bye bye. Now, first thing we're going to do is we're going to go back to minimal default. That's not what I wanted. Go here. This looks good. VP flying on. This looks good. Just pilot air No, you guys just let it off. That we can fix. All right, I. Now let's... What to do next? What to do next? Should I add more buildings? No, I don't think so. Let me... First of all, we need to go to Death's screen. That should, this looks fine. Crashed. Now we need to create a binding for this button event here. So what we're gonna do on this onClicked is we're actually just going to restart the level. So what I can do is just type in open level. And then I'm gonna type in the name of the current map that I'm in, which is minimal default in the top left, top of tab. the mouse back to the screen. Now, where do we create that? BP Buildings. And Flying Pond. And Graph. BP buildings and flying pond graph add to viewport Get player controller I need to drag it in from there, don't I? It's a show mouse cursor. And show mouse cursor to true. Pull the execution in. Play. Gosh. Last control of the plane. Oh no! What? I can restart.",
4
+ "language": "en",
5
+ "confidence": null,
6
+ "duration": 1077.29
7
+ }