Prototyping Perry PunKin - Unity3D Game Dev Process

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
are we live yep hey what's up everybody I think stream should be good now we're gonna get going today I wanted to do something a little bit different instead of pre recording something and showing you kind of step by step how I build something in a way that's all edited I wanted to go through the process of how I go in prototype a game so I came up with a quick idea for game last night just talking to my wife and we're gonna put together a little pumpkin based Halloween game I'll show you the steps that I go through to just get the thing up and running quickly kind of iterate over stuff and show you how I connect code and do things as quick as we can so we just started off with an empty project here and like I said I want to do like a Halloween theme and I talked to my wife last night I'll show you guys real quick the the amount of info I've got here it's basically that she wanted ghosts that are floating pumpkins and she wanted to call it a pumpkin we talked about catapulting things and maybe making the pumpkin tell some jokes having some candy corn and I really like the idea of bouncing the pumpkin around hopefully my stream quality is good enough if you guys are seeing problems with it can you let me know it's hard to tell what's going on here YouTube is giving me a hard time all right anyway we'll just get going building stuff so the first thing I wanted to do was just well I guess maybe talk really briefly about the flow for prototyping stuff normally I try not to write out too much and when I'm prototyping the goal is to figure out what what mechanics are gonna be fun how they're gonna work and whether or not I actually want to go forward with stuff so I like to do these quickly you know maybe spend a couple hours at most prototyping out of mechanic and and kind of a feel for a thing and see if it's gonna be any fun I have no intention of turning this into like a big full game or anything I just kind of want to go through the process and have fun doing it so to start off I'm just gonna grab a pumpkin and I already know there are a couple in the asset store I did a tiny a little bit of Reese before this but I tried not to go too far so if I could go down in the project view just search for pump and hit asset store tab I should be able to find some pumpkins oh wait now it's telling me the asset store is not available that's awesome let's just go directly to the asset store I think my connection failed there I've been having some weird internet problems lately or the Wi-Fi just drops off and then pops back on again hopefully that's not killing my stream it looks all lagged out and frozen there so if it is broken please just say something in chat let me know and I'm gonna pause and maybe restart and fix it why can't I connect to the access door this is very strange so this is not normal let's just close and maybe reopen this here just kick off a new instance of unity and we'll call this pumpkin - pumpkin - folder let's see now we should at least be able to to create something I hope or connect and nobody said anything in chat right other than hello world oh okay it's blurry ah okay that's an issue um hold on I'm gonna lower the bitrate real quick and just see if I can fix this so we can have a nice good stream because I plan on going for quite a while so I want to make sure that the the quality is good not used to streaming here on YouTube or anywhere really 30 seconds this would be back up okay I think we should be up now and hopefully the stream looks better and my internet is apparently working fine in this project so we'll go forward with this one and we're just gonna search for pumpkins again I'm gonna try it doing it down here in the asset store cos now that things are working or done in the project view just because of what in one ways I like to search and it looks like it's working so pump can and you can see there's what 41 assets there and if i zoom it up I can actually scroll and look at things and let's see it looks like these are mostly icons here in the middle we got a couple models get this one and we've gotten I think I want to go with this one because it's got light in there so I just hit open an asset store you should pull up the package and I only looked at free once it looks like there's some paid ones too but I think this is gonna match with my art style well and just pull in a pumpkin pack and in this case since I'm prototyping I'm gonna pull in the entire package I was doing a real project I'd be a lot more careful about what I was pulling in and throwing in here since this is just prototyping and trying to figure out what we want to do pulling it all in is fine because it's not like a long term thing I'm going to keep so let's go to the scene view real quick take a look at the prefabs down here and I think let's see there's a glowing and irregular I want to use the glowing one maybe we could even do something with the lights and have it like light up when he bounces or something maybe you can see ghosts with the light that comes out of his eyes that could be kind of cool so just take him drop him into the scene and go to game view get an idea what he looks like it's actually kind of close to what I want so it's thinking side scroller like weird bouncing pumpkin like bouncing on platforms of waiting things so interestingly he's already in the perfect position I would go to the scene view go back to the main camera just go take a look real quick and see what we've got here for our scene yeah this is looking good stars our pumpkin at 0 0 almost he's not zeroed on the Z so put 0 that and that's usually just the side effect of the way that it was saved on the asset so when you export an asset pack with the prefabs it's gonna keep all of those position values and it looks like they had that one set at one probably because they were side by side uh but this is one and that one's at zero because they're side-by-side in a scene and they got applied like that okay well we got our pumpkin and let's get I'm gonna start with like a really simple ground just do like a cube maybe two cube platforms bounce back and forth and then figure out some art I was thinking like some cool mushrooms or something Halloweeny if you guys have some ideas I'll ask for them in just a bit so you guys have some cool like theme ideas for things you could bounce around or want to look for them feel free to do that while we start putting together to the basics so just make a cube here and reset it and then move it down a little bit on the Y maybe like a negative 0.5 probably make it about 0.5 tall and then 10 if I can that seems good I've got a nice big cube I can bounce on just hit play and see what it looks like in game mode perfect well almost perfect not quite right because I still need to do a lot of changes to my camera but but it's in the right position at least um let's see now well actually here let's fix up the camera first before we do anything else let's go to the camera I'll go to game View mode and I want to change it from perspective to ortho I want to go with like a slightly flatter camera might move it up or down just a little bit yeah I'll just leave it for now I'll leave it where it was where was it at 1 oops why redo control Z and control Y by the way that's why everything's bouncing back and forth without a me moving the mouse just undo and redo alright so let's see let's save that off and let's make this little dude bounce and go back to the scene view select our pumpkin add a rigidbody and a Collider so we'll go with a sphere Collider seems like the perfect type for this shape I almost thought maybe like a poly Eric capsule Collider but he's not he's kind of rounded and I want him to kind of bounce and roll anyway it'll be cool so we've got our pumpkin dude here maybe shouldn't roll I don't know we'll see got a pumpkin he's set up and if I hit play again I assume he's just gonna drop to the ground perfect now let's make him bounce next simple step so just go to the assets folder create an empty folder make a physics material folder I could put this in the root but I'd rather just make a folder for it because I might end up making more materials for this this seems like the bouncy physics slide II type thing where where I come up with multiple so I'll call this bouncy she's making a new physics material and then if we go select our pumpkin we can assign it to the collider right here the material of the collider and I just double-click on it and open it up set that bounciness up to a 1 and the bounce combined to maximum I'm probably gonna set the just turn the friction down to 0-2 I want this got it to be nice and bouncy from the start he's gonna probably bounce kind of out of control but let's just watch there we go alright we've already got a fun game right got about some punch so um we got a couple things we could do now I could either make him move or we could maybe get some more control over that bounce so that he doesn't keep going higher and higher and higher and higher and higher I don't know which one I want to do actually let's just make a scripts folder and then we'll see what I type first like a folder of scripts making it move around seems more interesting and more fun so I'm gonna make a move script let's do that so just call this a mover just gonna be our pumpkin mover select the pumpkin and attach it and then we'll actually write some code oh do a compile did we get a car let's collapse all this stuff can I sign it here yep there we go let's open it up writer should pop up we haven't used writer in 1080p in a while so let me know if it gets weird if it doesn't fit right I guess I'll find out whenever it opens up what if somebody asked what the prototypes for I for fun I'm just to kind of go through the process um wanted to show how I'd throw together a quick prototype if there's a game idea I want to see it in action I want to see like if it's something that I might want to spend more than a couple hours on or not and it's just kind of throw together a real quick prototype and I wanted to show what that process looks like how fun it can be and also give people some insight into just how I'm coding with stuff max value for the bounciness is one and the max the min and Max for all of those is one it's basically like zero to a hundred percent so you can go all the way down to zero or all the way up let's see so we're not going to need an update we won't need a start we will need an awake though because I want to grab the rigidbody and we're just gonna add some force based on the input if you think about this game like we're really gonna go off the horizontal the a and D or left and right if I grab out a controller and maybe like we could add like a fire or something that shoots off a grappling hook with vines or maybe shoots out some pumpkin seeds or something candy corn make some vomit or something but I don't I don't anticipate that we're gonna do more than like left right and a fire button so for our input we'll just read it directly in here if we had something bigger obviously and it wasn't a prototype we wouldn't do that but in here it makes sense we'll just read our input so but first we're gonna need a rigidbody so let's add an awake and we'll cache the rigidbody just like this and go add a field for so that's by the way home the hotkey and then alt enter and enter is kind of like how we quickly generate these rigidbody things without having to do all that typing and just do rigidbody dot add force and then we'd give it a force amount to make it move left or right but we need to determine what direction we should add and whether or not we should even well for now let's just go in the direction that we want so let's add a float here for horizontal to say float horizontal equals input that get access and watch this quotes type H and writer autocompletes of course it always adds that extra quote at the end knowing but I just said delete in a semicolon then we'll add some force in the horizontal Direction times let's give it some movement force this is writer yeah we're in writer and loving it somebody asked a question about it and then for the Y we'll add 0 and for the Z we'll add 0 this is just gonna be like a left and right force mouth that we're adding let's um generate a field for movement force there'd be a float and a give it value like five I don't know that might be too high might be too low and we'll make it a serialize field what's that's wrong because we want to modify that in the inspector and also if I had alt shift and up arrow I'm making move right up to the top where I like my serialize fields to be make that private I mean it's already private but I just make it explicitly private only so the text lines up and um I think that's it let's get rid of these actually using statements so that should let us move kind of left and right just based on input right nice and simple nothing complicated yet hit play get an idea of if that works well it works it moves really really really really fast that's good um it's kind of snappy I want to limit that movement speed though I don't want to move it I don't want to add force if it's going too fast left or right right so let's put in some limiters in that they'll go back into the mover and let's add in a maximum force field so I'm just gonna copy and paste that let's call this uh underscore maximum velocity and I spell it max because nobody ever writes maximum and let's see what's a good value for that five is probably too low but I'll start it at that so what we wanted to do here then is check to see if we're moving right then we want to only move right if our we only wanna add force if our velocity is greater than that amount if it's uh or do I just want to do it like a clamp and a limit so let's I do like this I think so I could go rigidbody dot velocity equals rigidbody dot oh wait well we'll give it let's just make a new vector3 it's a little bit inefficient here what we're going to do but we'll make it a new vector3 and we'll give it the clamped X , the rigidbody dot velocity dot y and our Z is always zero but I'm just going to take it from the rigidbody so we'll just take it from there and then let's get a clamp 2x we'll just do it like this we'll say float clamped x equals mass F dot clamp and then we'll clamp it between negative max velocity oh what we have to give it the original value so that'd be the rigidbody dot velocity X so this is like the current velocity on the x axis is what we'll pass in and then for the minimum we'll do the maths velocity as a negative so just negative that and for the max would do positive max velocity so what it's gonna do is give us a value between the minimum and maximum velocity which is the max velocity of negative 5 and positive 5 really from our value so if we go above that we'll change it and then we'll just replace our velocity again not the best thing to do for like a long-term system but it worked perfectly fine in this prototype oh I see somebody asked if I have used unreal for at all and why I prefer unity over it I haven't used unreal for a lot I used Unreal 3 a lot and - I liked it like the engine but I kind of started using unity and fell in love with it and I just like using unity more so no real reason other than I love c-sharp and the pipeline and the process is just for putting stuff into unity there we go I've got a pumpkin that I can now bounce left and right and the speed is relatively constant so it's not getting too crazy I feel like maybe we should do the same for the bounciness but I don't know maybe we'd do that in a little bit let's see what we got in here for questions anybody asking anything nope cool if anybody's got cool ideas and thoughts to let me know but I think I just want to keep going with this so I've got the pumpkin here he's bouncing left and right and let me see it's bouncing around a couple more times trying to think Oh foot oh I definitely want him bouncing higher and add a steady rate so that his his up-and-down velocity is good and then I want to be able to bounce him onto something so let's do it let's uh let's make his bounce velocity a little bit more static so he has a minimum velocity going up and down and a maximum velocity going up now you just kind of clamp that um that bounce stuff too and we could do that in this mover we could do it in another bounce script this is gonna be really really simple though so let's just clamp the the y in here too so say float clamped why oh wait but this is I think that's true for a moment because we want a max we don't want them going up too high or down too fast but we also want to have some I do want to have a minimum no uh or just clamp the Y let's just do that so just say or do it just like this I'm gonna copy and paste this we'll take the well here we'll take that I know the Y sorry and for the velocity let's let's call this max horizontal velocity so control RR opens up the rename control our control are just hold control and hit R twice so we'll call this max horizontal and I don't need to care about the formally serialized as and then what's a de max vertical to then we can copy and paste the max vertical and I just assume that this value is gonna be different and then I'm gonna paste it in q here I think that's good that's gonna clamp us and then I'm just gonna move the pumpkin up so he starts bouncing higher skin really I just want to see if I'm gonna be able to make something fun out of this if we're gonna have a good time with it or not and if there's anything to it I assume that there's not but it's fun and pumpkin based so it will work well for Halloween and just making a little thing initially I was thinking it'd be cool to put together like a version of a thing where we could control this like outside let the kids that are trick-or-treating somehow control a big thing playing on a projector or something but I don't have a really good idea for how you control it maybe put it like some pedals so they could jump on to bounce it left and right or something could be kind of fun let's crank up that max vertical I want to get this guy bouncing a little bit higher not quite there maybe like to attend you see when I typed in the one it kind of dropped right down okay that seems good so this is actually a reasonable control I mean it's not perfect but it's a it's a reasonable interesting little control just stop playing it and let's turn that up to ten and I look at the questions real quick Oh somebody was asking about discord yeah I'll link another discord invite in just a little bit let's see what do you think about lamp and mean approach for nan stuff and I'm game stuff I know guys who use it I've never done it myself it seems like it's popular still or at least it was when I talk to them but every time I've done non game stuff it's been like it's generally c-sharp or C++ or some JavaScript like very light JavaScript and would you ever take our job at the end of projects to fix bugs and add features I'm probably not it's I mean I would have in the past I've done it in the past but not the kind of thing I'd be super interested in now and somebody else asked what we're doing I just building out a prototype we're gonna put together a game just a little fun simple game to bounce a pumpkin around take out some ghosts do some other stuff and just have some fun going through that that whole process of putting stuff together let's see so we've got let's see oh whoops I hit play I'm gonna just make another platform real quick just because I want to bounce on to it and see what that's like and then I'm not sure what I want to do next either start looking for some art I just duplicated this cube by the way or I don't know like I said not a huge plan right now just kind of going with it and see what we come up with that's fun do let's move this sucker over here so let's say I just wanted to bounce on to that and bounce back I assume I can do that not super hard I just kind of want to get an idea what it feels like yep I guess there is that issue when you bounce onto something like when I feel like when I hit I need to be adding force upward I don't know it's okay though so I'm able to bounce around let's see if we can come up with a a cool little background theme or something well like I said before I wanted to do like maybe mushrooms or something Halloweeny that we could just have in the background that you can bouncing through the environment and then have ghosts coming up that you're avoiding and just go from there so let's see let's search for Halloween if anybody has good recommendations for a kit that would work well for this though drop them in chat said be curious to see and we want 3d environments ideally something that the hard part is gonna be finding something that it's a 3d environment it's also a side scroller cartoon Halloween farm what's this look like Oh kind of cool but probably not what we need keep looking keep looking come on Jason let's find something a mysterious forest looks like the the little the ground piece looks cool I could be a cool thing to bounce on but I think there's only one of them spooky 4 oh I think I have this one but yeah it doesn't look like it's gonna work I need something platform me something cool let's see ya bats flying around would be cool - yeah somebody asked this to be a video yeah I think all the livestreams just automatically get uploaded as videos unless you tell it not to you just have to go to the live streams tab let's see what else do we have come on nobody's found anything cool yet either doesn't necessarily need to be a free one I just want to find something that well maybe it's my word Halloween that might be a bad search a search for platformer environments under three B see what we can find here um sci-fi platforms no come on there's got to be something platform builder assets uh I could use those they're not really themed very right at what I want though it's something a little spooky err or mystical or something like that see anything in here that matches alright I made you some giant like that blocks and then maybe like some giant mushrooms I can just bounce on to be fine like just something different I'm gonna search for mushrooms cuz I'm not having any luck here a little moon background that's a good idea - lets get that mushroom oh I should not make one how did anything show up with the word platform mushroom oh yeah something maybe like that but a little more cartoony big mushrooms what is this maybe man I was just trying Oh mushroom land oh and I have it that's funny please look um I like the color if I could get the the full the full screen art to show up I'll let me just download this and check it real quick I'm not sure that this is gonna work this looks really really old the fact that I have it means I got it a really long time ago probably but I'm gonna keep looking um you can see mushrooms oh what is what was that one where to go I just saw one Suns much this one looks kind of cold here I'm just finding all kinds of mushrooms and that's about it somebody asked what ECS is ECS is the entity component system it's the it's kind of a new way for building apps using the data oriented tech stack it's something that were definitely not going to talk much about today though not something I would use in prototyping this kind of thing let's see there are a lot of mushrooms out there Wow apparently artists loved to make mushrooms I did not realize just how popular they were maybe I will just hit the free button cuz there's so many of them let's oh that's why I had so much because it was free that's funny what else you got here this one glowing stylized mushrooms that could be cool but I want more like platform mushrooms well let's try the one that I just downloaded and see if this one works so it's downloaded we'll import it which means that the window is gonna pop up somewhere else I'm gonna pull this sucker in Oh what do you know popped up right in the middle that's never happened hopefully this isn't 2d it looks like it could be it's really hard to tell shouldn't be though it's in the 3d section all right let's he's come in yeah well while this imports anybody got any other questions but stuff we're doing or random stuff oh if someone said put a cannon that's at a fixed point that's not a bad idea put the cannon so this fixed point and shoot the pumpkin add control the fire it button for outside Halloween let the kids fire its pumpkin oh I like that let's see let's see what we got here did we get mushrooms imported yep yeah let's save off our sample scene and then open up their example and see what it looks like looks like a lot of stuff it's all turned off all these game objects off yeah that's weird let's turn some on oh yeah I think these seem like they might work perfect well maybe not some of my well whatever let's go back into the sample scene and see what we can do going to here it doesn't have to be perfect right it's prototype to make sure that we can have fun gameplay and make it kind of neat and and decide if it's worth putting any effort into doing more so go into environment I assume prefabs and that's weird no preview huh that's a preview we're not working strange let's find some shrooms uh-oh they're all off that's why all the game objects are set to OFF let's turn all of them on by default maybe then we can get the preview I didn't realize that the preview doesn't show up if the game objects off that's very strange I must it must be because the renderer is not showing let's see let's uncheck and check one I wonder if that's a bug in this beta version of unity or second no thing interesting well well we've got mushrooms now ok looks like we mostly just have a lotta a little bit of riot II wears a flat one do we have any that are nice flat on the top or not this one looks semi flat a shroom number 12 holy crap that's huge ok let's shrink that down so was our shrink shrink shrink and I get rid of this other mushroom here alright so if I want to make my pumpkin bounce on this mushroom I'm gonna need to move it and drop it down we have it what are we looking at I get a zero out the Z and then drop it down a little bit more and do a little bouncing first so yeah the problem I'm having is that all of these are very very pointed so I think getting a bounciness it might be weird but I kind of want to try it just to see its add a mesh Collider Wow it did kind of what I expected it to do let's see oh I'm not bouncing on that oh and we're bouncing off to the side we need to lock the Z or the yeah the Z position here so I got the rigid body of the pumpkin select they've got to go to constraints and lock the Z position and rotation because it's no longer flat as bouncing back behind our our mushroom there we go so now we're or we're able to bounce on it it's not anything like what I want though I'm gonna find some flatter mushrooms let's go back to that asset store search for flat mushrooms it's got to be something under flat mushrooms right let's search for mushroom platform let's see there's got to be something here and we'll go into there's 2d environments I'm feeling like man I should have done 2d instead of 3d it's too late though I've already committed hand-painted turnable platforms you know what this is not what I was thinking at all but I'm gonna use them because I can just have it bounce around on these platforms I can place them in the air and I think that'll work and I still get the same feeling and they've got little mushrooms on them so that's like halfway to what I wanted right plus then I don't have to spend a bunch of time looking for art because that it's a good way to kind of dig yourself into a hole and get nothing done I've done it before where it's been forever trying to find perfect art and then realize like it's been 2 hours and I haven't actually completed anything okay what what is this let's go to prefabs hopefully they're set up there we go mushrooms with red mushrooms okay that's actually just the mushrooms the prefabs let's go to platform platform one yeah platform 2 oh this is gonna be good I think this will work yeah there okay so let's delete everything other than platform for cuz that's the one I like the most and he'll take that sucker reset the position oh man yeah this is perfect I'm gonna get rid of these two cubes just I'll just disable them for now take the platform and let's add it oh it's got a box Collider on it where's the collider let's disable the renderer oh I'm on the wrong thing nevermind it's like the actual platform there we go that explains why I thought I saw a box Collider there oh that's gonna be super performant whatever let's just add a slider here where's that a box Collider and we'll scale this sucker up or down get it to match remember this isn't gonna be 3d so I just need to get it right on on the X really the Z doesn't doesn't matter so much just has to be wide enough on the x axis cuz it's gonna bounce down onto there it's not gonna go the other way but I may as well scale it out here anyway there's no harm alright save that sucker off and hit play my positions are right there we go can bounce now on the little platform cool so now I've got a platform that I can use let's turn it in to a prefab make a prefabs folder and we're not gonna make subfolders for this because I don't think we're gonna have multiple environment pieces and we'll make this an original prefab I really just wanted to make my own prefab outside of the the one that came with the asset pack so that we could start keep it from getting updated or change I was reading a question in here why did I turn off the z-rotation because I don't want him bouncing and rolling backwards did I not lock it though yeah I wanted yeah cuz I don't want him rolling the opposite way unless I did the wrong rotation I might've hit the wrong one I'm not sure whoops I think Z was wrong yeah I think it was supposed to be X rotation okay well whatever believe them for now let's get more platforms I want to get this platform down so let's pull the game view inseam view side by side and then take the platform I'll switch to 2d mode hit W and pull that down to you I don't know right around here actually should we start off over there well here let's move the camera there now we're starting off on the left side of the screen okay so let's see let's make some more platforms I'll duplicate the platform move it up duplicate and just kind of make a little a jumping ramp or jumping area for now let's see how that works so we can bounce around whoa whoa yeah we definitely need the rolling back end though kind of able to get over there let's stop why is he not rolling anymore oh sorry I uncheck the wrong way I was reading rotation in position wrong so we would do want him to roll like that we just didn't want him to um to move there we go now he bounces and spins perfect ah and falls to his death I feel like there should be some kind of a death thing back so let's put in a moon background - somebody had mentioned that and put it in yet and I want to get that knocked out so let's do it let's close this off search for a moon and this could just be like a skybox or something else or let's search for spooky gonna find like a spooky moon background yeah I'm more like that or that spooky forest environment the guy to have that one looks kind of cool thought I had this one no if it's gonna work for a background though so let's see find something spooky come on spooky background that's odd whatever let's give this one that seems fine spooky woods parallax background we'll add it in pull it in okay if we can figure out why did not just check out that's the weirdest thing ever move apparently things have changed a tiny bit let's go do a check out in another tab real quick and okay check another box there we go I think we're almost checked out that's weird every other time I've ever bought something the asset store just click the button and it just did it seems like maybe it's just the account or something all right that should be done it should be purchased come on let's see if we can use it oh I hear myself talking that's not good okay let's pull it in downloading downloading take a drink oh no I forgot to finish my ice cream bar and it melted I'll let me throw this away before it turns into a mess on my death bother some birds ah all right we should be done did an import um what was it called I don't see it I must have just downloaded and not hit import getting myself mixed up there all right pull this sucker in let's see what these look like go back to that scene view let's see where did they put this so it's in spooky woods okay they've got some prefabs man I just bought the prefab and see what it looks like spooky woods prefab it's got a bunch of layers stuff oh no it's all 2d sprites ah let's look at their example delete this open up the example scene hit play into it what they're doing here um so yeah it's a little bit jacked up apparently whatever we can take the textures it'll be good enough sometimes that happens so going to here is got to be some textures they got to be referencing something right okay maybe I was a little too optimistic why is going on here so they got a moon and then they've got a broken prefab that's missing a bunch of sprites why is it missing sprites oh because they're all freaking PS DS and nobody thought hey what if they don't have photoshop installed oh man that's why it's maybe why it's not pulling them in I don't know no it's still I'm not sure what the hell is going on here I am going to just find a different background because I don't want to deal with a giant mess spooky background I'm just gonna search on Google Images cuz that'll work just fine yeah there we go we'll find a nice little image we use that for now if I want to change it later and change it later that one looks kind of cool here let's do a filter so when you search on Google and go to size and you probably want to go to large and we're not looking for transparent stuff we just want to find big images and then we want to find ones obviously they don't have watermarks that we can use just to drop onto it and of course if you do it in a real game you're gonna have to buy art or find art that's free to use when you just thrown together a prototype and you're not actually releasing it anywhere or whatever just grab what everything oh I like that one that's really neat I take that for now save an image as and then we just drop it to the right folder so we gotta go under and get Halloween - and now where I save this off let me see but that was the folder I'll pumpkin - sorry see you : sighs get pumpkin - and then we're going to assets and let's make an art folder why does that seem empty that doesn't seem right let's move this over get the feeling that this is the pumpkin one not pumpkin - dang okay all good so go in here create another folder create that arts art folder again the reason the folder was empty is because I had the other copy of it that I used it and didn't end up using as our project so we'll go into art and just take the saved off one and drop it right in there get the same thing done right now we can take our spooky background and drop it out into the back so we have a couple options I guess we if we'd built it like 2d like it probably should because really activity game then I'd put it as a sprite but since I didn't and I'm just kind of screwing around with a 3d one I'm just gonna make a quad and throw it in the background so let's make a quad sign the spooky material to it kind of scale it up get it into the background and get it so that I can see it and then start scaling it more let's actually put this side-by-side you can see the game view in the scene view go to uh there we go the rect tool yeah we could scale it even to fit and kind of stretch it out I think it still looks neat yeah that definitely looks cooler I'll save that off now I'm kind of feeling like the perspective camera might be better just so I could see the tops of those no I don't know how having fun with it though so I would save that off and let's grab that main camera here let's pull the game view over here so if I did do that if I took the main camera and I went back to perspective obviously not leaving it just like that but I went to perspective and go to demo or 3d I find the camera again sinking like if we brought it wait a minute what if I I just want to try this real quick I'm gonna try parenting the the camera under the pumpkin zeroing out the X & Y so that it follows the pumpkins height okay let me try it and then I wanted to I'm gonna play with it real quick I'll see what it feels like and then decide if I want to spend a couple of minutes fixing the background and see if it's gonna be like a an interesting way to play okay let's see okay so maybe we'll I'm liking the feel and the look of it but obviously not with the the spinny spin so let's pull in cinema Sheen I think what I'm gonna do is set it up to follow the follow him lightly or relatively tightly will fix the background so that it fills up and then have it kind of follow him is bouncing along I think that that could be fun and then with the cinema Sheen we can add in as a little barriers and boundaries so that it's not super tight I think that's gonna be right that sounds like fun let's do it so a package manager and then we go in package manager search for well I don't really need to search it's right there go select in a machine if you don't see it by the way make sure you're on all packages not just the end project one and we'll install it you like the spinning upside down part is reading through the chat don't forget to like the video by the way everybody it's only got 22 likes right now 23 alright alright so cinema Sheen is in if you haven't used any machine before by the way it's really cool um camera controller for unity makes controlling cameras nice and easy so it's something I would highly recommend you always play around with now we'll create a I see if we want to create a virtual camera and then the virtual camera is gonna have a follow and look at target of the pumpkin so we'll follow the pumpkin actually doesn't even need to necessarily look at the pumpkin it's just gonna follow it let's hit play now see how cool and easy that was like that was literally look at spins bounces all I did was create a camera and assign what it was following I didn't have to do anything else to make that work which is why I like it now I can there's a ton of options here I can change how fast it follows how tight it follows how close it is like where's there's a bunch of settings on here Oh follow offset so if I'm gonna pull it out or in or go up or down from it or left or right or want to adjust how much it dampens like how how light or closely it follows I can adjust it right there so it's really cool if you haven't used it but a camera follow script would work too but I can just do this I don't have to write any code and I have a ton of extra functionality without having to write anything it's just all kind of there and it does like this is you know 1% of what's in a machine does the fact that I can just create a B cam assign it and have it follow is just a nice little benefit now want that background different so for the background trying to think what I want to do like what to do what to do let's see let's pull the scene view in the game view side-by-side I mean we could just pull that back and scale it up for now we could um make it a UI component and have it kind of stick on there I'm not really sure like I said I hadn't really thought much about a background so I don't have a whole lot of idea for for how I want to manage it I know that I'd like it to go on for a while though so let's let's kill us like 40 by 40 by 40 it's still not gonna really work and let's bring it in closer to the camera and just let them bounce around with it in the back yeah I just don't I don't like them but the like I like the background itself I just don't like the way that I have it set up yet and I'm not really sure how I want to do that I guess realistically the background isn't a key part though so let's just get it okay the background is just there to make it look kind of cool let me try doing it on a UI later and see if I like that real quick so go to game objects UI and we're just make an image where's image I always missed that one and and for the image I'm gonna go select my spooky I'm gonna change it to a sprite for a moment sprite and apply and then we'll find the image catch the spooky and then we'll make it fill the screen and we will really want this to render before I feel like it's just gonna be weird though as a background I guess a skybox would be not a bad idea either yeah a lot of ideas a lot of options but this this texture size is really weird to write it was a 1700 by 800 I'm not even sure what what would happen if I try to put that in a sky by I think it's gonna get really weird and stretch right so I want to push this back ey back behind the 3d stuff it's been too long since I needed to do that well we could just make the main camera do this hey hey clear box clear don't clear and then we'll make another camera just make it camera I'll call this background and this one will clear to solid color and it will only render UI so uncheck everything and only DUI and then this one is going to not render UI so we'll go to culling mask and uncheck UI and then we have to put them to draw let's see which one is it ah sorry guys huh remember how I did this last time it's been too long since I tried to draw a background in the back so clear flags don't clear that looks right that looks right why is it wait why is it showing up in the background still hold on rid of that quad and then if anybody sees the canvas order of the lair now there's a I need to set the cameras rendering order this camera should be rendering first I just forget we're there we go just need to pull that depth back and then turn this canvas on oh oh oh and this shouldn't be screen space overlay screen space camera set to the background camera there we go that was probably so overlay it's gonna draw on top all the time for the screen space overlay I just had it set like that so said it's camera set the camera there and now we've got a background that's drawn in 2d and our 3d foreground let's see so the background should just kind of stay the same not not amazing like it's not a cool parallax background like it should be but I think it's good enough that I can bounce it around and try to avoid things if somebody's asking for advice on how to offer unity extension development work I'm not sure where where you would do that it's not something I've come across a lot I'm sure there are people out there using them I just don't know of anybody who like specifically hires for those types of things all right cool so we got a pumpkin he bounces around we blew a good amount of time just setting up a background cuz that's what happens when you start messing with stuff like that and now I want to do some more game mechanic stuff I really like I want to add in ghosts to avoid set those up moving around I want to have some sort of a target to get to I feel like it just needs like a goal though like something that you try to get to and some code like maybe something for whenever it bounces having him do something interesting I don't know I said game design is not necessarily my strong point collectible thing could be cool to maybe let's say you know my wife wanted candy corn in the sea let's see if we can add in some candy corn is there any 3d candy corn does not look like it there's definitely lots of candy though yeah let's go I'll go for ghosts first I know I've got ghosts we can use so oh god these toon ghosts are good let me use these guys did not have them on this account yeah I guess not grab some some ghosts oh whoops I hit okay along before I had finished the checkout my my fault sorry all right let's check the button and hit the button and grab our ghosts so we'll use these little dudes maybe have them fly around and I kind of want to do something with the the light coming out of him too like maybe do that as as his weapon like have it so that if he's facing towards them his light like stops the ghosts I think that could be cool let's do that that'll be that'll be interesting at least all right viewing car come on give me my ghosts let's pull these things in so thinking like you know a jump if the light is hitting them or they're like in the array then we can do something different to the ghosts like make it so you can go through ghosts but only if only if your bounce lines up so that you're you're facing them I don't know if that's gonna be fun but it'll be you know that's the point of prototyping so I do this kind of stuff just mess around and see what's fun and what sucks and do it in a nice quick easy way so we can just throw together and we don't have to hey guys is not the kind of thing I'd want to blow we prototyping out right is this fun is a neat mechanic we're gonna find out so there we go got tuned ghosts let's see you've got controllers or they probably have animations right let's see let's save our sample scene again I'm gonna go into the demo real quick and just see what it looks like okay so they just if they have a couple different animations I think we'll probably just use the normal floating one yeah we'll just go with a simple flying so I take a blue ghost let's go back into the sample scene let's go find some prefabs and just take a random ghost drop it in at zero zero move them over here check them out in the game view oh it's too far over there it's moving back over to the left a little and rotate them cool so that's what that goes look like right now I think that I want him to be transparent though so let's expand that guy out and see if transparency is an option so where's the there's the mesh standard material let's change it from opaque to fade oh I don't think that's looking too - likely to work oh oh maybe no not really yeah that's gonna be an issue I mean it's not a really an issue just I kind of wanted to go with some transparency but I don't think that I think it's gonna be too much work to get them transparent I probably just turned down the emission though I think it's just the the emission is so bright on them that it's making them kind of blow out well maybe what I can do is make them glow up when they get lit up so when they get lit I can just turn that emission on and then when they're not a lit make them dark so then go okay they're lit up and then we can go right through them I don't seems like fun let's try that so we got a ghost here ghost is gonna be a bad guy let's start with him just uh maybe moving up and down I don't know let's see what would be a good movement pattern for the ghosts so I feel like almost like a circle would be good there just kind of move in a very well let's start with up-and-down right we'll go like from a start point to an end point or from a start height to an end hey let's just add a simple script let's keep it keep it simple we don't need to do anything crazy let's call this a ghost up down and we'll add that I'll just create a new script and get to writing some more code all right um let's see first thing I want to do on enable is cash the Y position so let's add not enable I'm gonna say like starting Y position or start position y equals transform position dot y and we'll just cash that as a float the reason for this is I want to go up and down some distance from that float I'm gonna add another float so just copy and paste and let's call this a height variance and I give it a value like two and make it a serialize field so we're sinking here is that this would be how high up and down it goes from the start position and then we'll add a direction so private float or let's add a bowl well we're gonna do private float yeah that's deal float why is it keep doing that in private float space direction okay there we go and I'm gonna default this to one which will be up so up will be one down will be negative one I could do like an enum and Direction stuff but I think it's over complicating it for what we want here we don't need a start um we might need an update and I don't know why writer is not fitting right there we go that's better there go right or go ahead and fix Windows Defender have fun okay so let's say private here just because I like to and then we'll move in the direction that we want so we'll say transform position or transformed out translate let's do it that way and we'll give it our direction so we'll do vector 3f x direction and then x time Delta time and then we'll check if direction or we want to check the position now so I'm gonna see if we went too high so if we check our if transform dot position dot y is greater than start position why Plus height variance in that case we want to switch directions so we just do a direction start equals negative 1 now we can copy that and say if it's less than the start position lower then we also do the same thing so those are both the same thing this could be like an else if you know if I put else just make it a little bit more explicit it could also be an or so we could say like if that's the case in fact it's probably the way I do it that or that then do that and then I would put braces here because it became unreadable so just say hey if we went out of position then move in fact we should do our movement after that so do alt shift and just drag that down with the down arrow nice feature and writer just moves the whole line or selection down so yeah I think that's it right I should move our ghost up and down hopefully I didn't miss anything let's see let's hit play go should bounce up and down push there he goes there you go like that there's our ghost thumb he does have a shadow under him kind of an issue and he doesn't kill us but he's moving neat let's see let's adjust that I want to give him some speed control so it's copy and paste and call this like a move speed and right now he's out 1 so doubling at the King might be good and we'll go down here and just multiply it by that so we're adding it to that translate call let's try that with him going a bit faster there we go look at that ah okay cool so we've got a ghost now we've got a pumpkin and we probably need to make a way to get past the ghost or a reason to get past them not just bounce through them so let's make the ghost have a Collider and make the ghost the murderer so we'll say like a box Collider because it looks pretty square go into here and drag it up F by the way to just focus on a thing we get our box yeah that looks pretty good let's scale it up just a little bit make it a little bit taller than him I want our players to suffer and we'll make him a little skinnier though cuz he's too wide Oh wrong one there we go more like that so you actually have to hit him but if you tap him you're dead so we got a box Collider now let's add a whoa let's see I do let's add a kill player script so I just had a component say kill player I'm just gonna name it that will open it right up come on kill player open up here so here get rid of all this junk and I'm going to say on trigger enter if I'll say like a bar mover or mover over equals other dot getcomponent mover I just wanna make sure that it's the player we're not putting to move around anything else if mover is not equal to no um destroy we're just gonna kill the players game object for now move or Die game object totally bad it's gonna make it so we can't continue playing and stuff but I just want to see it like poof and disappear so we got our kill player script when we enter the trigger it should kill it fact let's go back into that let's watch this let's add a couple things require component type of Collider because we want to Collider on here and let's add in on validate so on validate will say get component Collider that is trigger equals true cuz I want to make sure that this thing is always a trigger add it to something else if I had the kill on player and it doesn't have a Collider I want to know I want to be like a reminded and if I do have one I want to make sure it gets set to trigger its again simple not really over-engineering because it's a two liner and it's just sitting there to stop me from making accidents as I'm going through stuff there we go BAM look at that so may have noticed everything broke too because remember our camera was a child of the pumpkin so everything was good yeah I'm good let me look at the questions real quick I see there's a little bit of chat going on I don't through anything does he ever talk to us or nope actually yes yeah so if you guys have questions some feel free to ask I'm just trying to focus not on this as much as possible when I look at questions but brain tends to shut off and then I can't I can't remember but I'm trying to watch them both so we've got a ghosts that move around we got a pumpkin that bounces around what all want to do like say you hit a ghost do I really want to kill the player I kind of do I don't know I don't know if I want to kill him or like make something pop out of them for now though the next thing I want to do I think is well here let's change that code up let's make this do I just reload the scene I'll just make it research so say a scene manager load team zero and it's just gonna force reload our level so we'll save let's let's try that real quick save this off so at least then when I win a die and restart it goes good I'm doing good thank you okay so every time we hit it oh if we hit it we die in stuff happens in fact let's um let's add a little kill area on the bottom of the ground - let's just go game object 3d object cube reset this thing I'm just gonna put something so if I fall down too low I just die and I can just do that like this is literally just for my test so I don't have to worry about it we'll add the kill player script and turn off the renderer so now if I fall down I miss it's gonna reset and I don't have to worry about writing any code for yet but there we go I mean obviously if I fall too far to the side not gonna work but this is good enough let's see oh somebody asking how brother can brainstorm ideas this is kind of how I do it just hop on start messing around with stuff I talk to people a little bit write down some notes and then just see what's fun what's not fun and go from there just start implementing quickly though and you just want to do it as quick as possible and start going on stuff like don't don't wait around and don't try to draw out and guess what's gonna be fun for too long I have a hard time with that at least I can't guess what's gonna be fun I'm always wrong okay so we're bouncing around we got the kill spot and I mentioned I wanted like the light because if we look at our pumpkin he's got light in there he's got eyeballs and select him real quick expand out the material so he's got some admission here so I could turn his emissive off and on and then I think he's got a light underneath him a point light so he's kind of lit up but I want to have him like shoot light out of his eyeballs so I'm gonna go down here and create another light underneath him so go game object let's go to light and let's make a spotlight I want it to shoot right out of the front of him so we're gonna rotate it it's gonna go this away let's see holding ctrl by the way it makes it do the snap so that's what that's why it's snapping by 15 degrees yeah I'm just gonna type in a 90 there so you've got it going at 90 degrees is it hitting the ghost there let's see so I want to see like let's pause and play I don't want to see it lighting up the ghost and then figure out how I want that that light to look so we got the I just paused it real quick so I've got the spotlight here real time indirect bounce shadow not okay it's fine so let's turn up intensity there we go you can see the intensity but I think if I make it orange and a red or something and turn up it doesn't really make him khlo like I'm thinking not sure what I need to do here because I feel like I should have done this in 2d just so I could have done the 2d lights cuz it would have looked a lot better in the background but I wanted to play with 3d models so I guess I'm stuck so let's see what do we want to do to just that spot angle I mean I can definitely see it lighting him up let's play and see kind of yeah so when he gets lit up like that is thinking is he could turn transparent um so let's let's add a script I'm gonna keep this simple and we'll just add a script on the pumpkin that lights up any ghosts in front of them and maybe makes them whatever transparent yeah so let's call this uh actually I'll do it on the light it's pumpkin light now all these scripts are going into the totally wrong folder so I'm gonna fix that real quick I have a scripts folder here and all these scripts got directly into the route let's just drop them into here not not doing a whole lot here but I just want to keep it somewhat clean right you're going to end up with too much of a mess even if we're prototyping like it makes it harder to get around stuff so in here let's just do a ray cast let's get rid of the start get rid of that and make this private and it'll do a ray cast to say ray ray equals new ray able to use transform that position and we'll go in the forward direction then we'll do like it let's do a debug that draw ray so we can see our Ray and we give it the same stuff here let's copy those so go up here copy paste and then we need a it speller so I usually go thread when I draw ray and they'll give it a duration we don't need a duration here because we're drawing at every frame if we're not drawing every frame like when we're clicking and shooting then we want to do it so the race days but since we're drawing it every frame we're good but we do need to give it a distance so give this a distance underscore distance here that's for the direction so when you're doing the draw rate it doesn't have a it doesn't have a way to set a distance for it you have to absolutely put that in the direction so we'll generate a field for distance make it serialized and give it like a range of I don't know I don't know 10 meters seems like it's probably way too high let's go to five so we'll draw that Ray and then we'll say if physics dot raycast and we'll give it the Ray we'll give it a distance there we go and we say where's the one without hitting though that's gonna be second or so they out var hit info comma distance yeah so if we hit something hit info gets filled in oh hey thanks for the superjet green tea thick oh trying to remember to read people's names oh yeah I should definitely zoom sorry thanks if you guys see that too if I if I don't zoom let me know remind me so I can pull up some you know zoom it in a bit and make it easier to read there's no reason for it to be tiny it's huge in front of my screen or in front of my face but goes down to a tiny window for you guys so if we hit something we'll say hit info dot Collider getcomponent and we're gonna try to get a ghost so I'm just gonna call this ghost doesn't exist yet save our ghost equals that and let's generate a class for ghosts so just go on to it alt inter create a type whoops make it a monobehaviour we'll make it public and then we'll go to ghost and hit alt enter and we're gonna move it to its own file by the way this is how I usually create code files if I'm doing a lot of code writing it's almost always in writer just typing the stuff out and letting it create the files I very rarely create new ones in unity except for uh when I'm just in unity non-stop and barely ever not creating many things but most of the time doing like this so I've got a ghost file here I'll go back to the pumpkin light I say ghost dot become invisible or become lit because it's getting lit I think that's good yeah I don't have a way to unwind the ghosts right now so I don't have to think about that for a moment but for now we're just add a method that make them become lit no this is not visual studio this is Rider it works just like visual studio I just like it better it's a slightly better editor for me for unity specific stuff I use visual studio outside of unity all the time but now I've made a switch a couple months ago maybe a year ago and I wouldn't switch back it just does too much it's not free though but if you use unity enough and you do enough code it's more than worth like the seven dollars a month it saves me way more than seven dollars just in time just the speed of going through stuff and little optimizations so if you're doing unity work professionally getting paid for it it's probably worth the investment if you're just getting started out play with the trial and all and if seven bucks isn't a big deal I highly recommend it but if it's if it works fine without it so becoming lit what is that going to do well we want to I want to disable the collisions and I want to what else oh yeah and Jason mentioned if you if your student you can get all this stuff you can get writer for free so just I think I don't know the exact process for it but I didn't know you there so check it out so when we become lit I want to what did I say I wanted to do change the omission or make them transparent let's go on to the ghost real quick because I'm going to expose something and I want to make sure that we're exposing the right thing so it's gonna be something on this tune ghost and what are we gonna do we're gonna change the material or just oh that's right I think I had mentioned turning off the or turning up the emission huh that's right so turning turning it on mmm it's not nearly as cool as going transparent though let me see if let me just do a real quick look here and see if there's some way that we can make him fade without like if I turn off the emission and I start messing with the Alpha I think this is better let me do that so what I'm gonna do is switch his go back to game view it looks okay like that I mean it's not perfect I'm gonna go with that I'm gonna do fade and I'm just gonna change the Alpha on here to fade him in and out so he'll go like that and when you light them up he'll go like that and when he's on but yeah so you can go through them when they're lit and not throw them when they aren't let's do that so I'm gonna set the render mode to fade on him go back to the ghost okay I actually add that Ghost script and then here let's add a reference to the renderer so sterilised field it's your private renderer renderer and then we'll get the renderer material that color equals cuz we can't just set the alpha alpha well set this as let's let's yeah let's set this as a serialized field I generate that field come on generate alt enter generate generate there we go and we'll add the serialized field attribute default to color dot white and we'll call this uh well actually normal is just gonna be white yeah okay so this isn't gonna be no color not why I think I'm gonna go with a new color so say well no I'll just do white in there because I'm gonna change it in the editor so let's say so go back into the editor I did ditch the underscores and then I ended up going back to him oh I got talked out of him for awhile and then I just got way I talk to myself back into him so let's go back to the ghost we'll assign the ghost as a renderer set the Alpha down to something low and I think that's good so now if I play let's see what happens it's probably gonna instantly hit cuz he's right in front of us let's go to the scene view get these side-by-side yeah and set that as 2d oh look at that range that is perfect it's just us I don't see what happens if I bounce over here oh look I don't know if you guys saw him he definitely went to that alpha mode now it doesn't go out of it so let's uh let's change that so I don't want to do this I really got a couple options no I'm not gonna put it up anywhere you're just playing around so I can keep track of the things that are lit by this or I could be lazy and since we're prototyping I'm feeling like being lazy as and easy as a better way so it's thinking like I could keep track of the things that are lit up and when they leave unlike them but I mean really I just want to light anything that's in front of me so I was thinking what I could do as another alternative since this is just a quick prototype is instead of ray casting from this spotlight I could go down here and let's create another game object like a cube QB right yeah okay the cube so create a little cube here and I can stretch this thing out kind of like that and just call it a trigger enter okay if you enter the trigger of my cube here you are a ghost if you leave it you are not a ghost in fact I could even drag this up and down a little bit so a bit more control and turn off that mesh renderer make this a trigger and let's call this like light cube then instead of doing a ray cast on my pumpkin light we could just change this to an on trigger let's undo that let's go on trigger enter whoops not particle trigger there we go so ontriggerenter I can do the same and we just do what Collider not get component notice how we're just simplifying things here and delete all that and oh it's other I really hate how it does that little wonderful call it other name is it collider in one spot another thing I guess it makes sense so that you know using collisions versus triggers I it still drives me a little nuts and then on trigger exit do the same thing but we'll call it become unlit one other thing I want to do here is add question marks just so that if we trigger int or something else it doesn't show up it doesn't call this and give us a no reference this is basically saying if it's no check it now it does give a warning and writer because here I'll show it because it doesn't check the life cycle of the object so if we had destroyed our pumpkin or destroyed our ghost and then called this we could still get a note reference exception I'm not gonna destroy go so I don't care now let's add I become unlit and here we'll just say renderer material that color equals color dot white and I want to clean this up even more like let's hit alt enter and turn these into expression body make them nice and small there we go it's a nice simple script so we come lit become unlit our pumpkin light I know let's just do the real check check expression for no let's do it do what writer says it's one of the things I like about writer people are talking about it in there it's just that it constantly just reminds you hey stop doing stupid stuff and it'll tell you and really yell at you with a little little yellow text all the time so there we go um they can mention adding codeine Oh light having the lit fade and fade yeah I was thinking the same thing we should do some sort of ramping there for the fading but first just make it work and then with that so here let's hit play so as we go in oh wait what's happening it's definitely not working why is it not working let's see our light cube is there what am I missing I'm missing something here oh we need for trigger to trigger collisions we need a goodbye kinematic rigidbody right so we'll add a oh wait and then this has a second all work let's see well go on to here at our rigidbody and set it to kinematic not using gravity that's right right let's give them except when I do these so what happens when you try to do a little little short cuts yeah I didn't have a rigidbody at first now it has one why is he not sure let me stop let me pull the side by side and see what I missed here I know I missed something let's get that right here and I'm gonna stretch this cube out and go to 3d mode so that cube should be in there did I miss something anybody see anything so we've got the light cube with the box on it so the box should be Oh huh I have to put the script on the right thing right let's move it from the spotlight over to the box and play again let's see now no he's still not entering the trigger is he what did I miss here where's our ghost so here's the ghost this got his up down he's got his box Collider he's got his kinematic rigidbody make it non kinematic it didn't matter that's right so yeah I think what I'm gonna let me see yeah so I'm gonna change this I'm gonna make the ghost not H not a trigger I think it's changing now when I when I made the ghost not be a trigger so there's really no reason for the ghost be a trigger I'm going to change the ghost to a collider change the collision inter or the trigger enter the kills to just be a collision inter and just make the ghost to not collide with the environment that seems like a good way to do it nice simple thing to do again you're just going to get this functionality working so let's see you go back into the ghost script no not the ghost it was the ghost up down I think no kill it was the kill player one so that's the problem have is the kill player script is forcing things to be a trigger I don't want that so I'll say it's triggers false and we're gonna change this to on collision enter and then this will change to collision collision then we say collision dot what is it that Collider yeah I get component same thing but now our collision for our box should work so let's go back into here you'll see the trigger should get unchecked automatically our rigidbody can be there I think we're good let's hit play one more time there we go so he goes off on well only when I'm facing the right way right so if I don't if I wrong perfect so the other thing I want to do is when he's in that ghost mode well I want to make it way more obvious that he's in the ghost mode but I also want to make it so we can go through them so let's make it functional first and then make it so we can go through him so here's that ghost script one more time so when he becomes lit all right now our kill player script is always on I can just turn off our kelp later script really let's so we're gonna have to turn this out of an expression body method because you're gonna do two things in it so let's change it back and let's uh let's add in a week and here we'll say kill kill player equals getcomponent kill player cache that and then here we'll just say kill player dot enabled equals false and change this back over to a regular statement body and just do the opposite turn it back to true so there we go now we can disable and enable killing players based on our little flashlight or our light sticking out of the front let's see if it works in fact what I'm gonna do just to make this easier to test is go to my pumpkin and freeze my rotation real quick so I'm always facing him so it's a little bit easier for me to do okay so you may have noticed that um let's see when I get into him watch what's gonna happen ah okay that's not working at all so let's see it let's take a quick peek I want to see if it's actually turning off the script first that it didn't miss something oh that's right I've read toggling the script on and off isn't gonna fix the the collision inter checks I always figured about that so it stops the updates but it doesn't stop those collision checks toggling the game object off would stop those collision checks but yeah that's not what we want so we're gonna do that well actually I wonder if I could use this like if this thought enabled equals false return I've never actually tried doing that let's see if that works yes we'll find out in just a moment okay look at that well it does work that's another issue I hadn't thought about so okay this is a problem right so the okay the camera is bouncing all around but I'm just going through prototyping this I didn't think about that I want to be able to go through this guy too so I need I need to be able to get through him but I need my light thing to collide with him so we could reorder Tex it and re-engineer it or we can just continue on since the prototyping and just do some physics layers real quick let's just say project settings I don't want to do this think about this for just a moment yep we're gonna so we'll open up this settings I was thinking what I'm gonna do what I wanna do is create a physics layer for the ghosts and those ghosts are going to only this physics layer is gonna only collide with the light and it's just going to turn them on and off this be like in fact I might call this like a ghost light or something let's yeah let's go to project settings where is that it's always pain to find this one project settings yeah that's it and then we'll go to physics and let's add oh you can't add a layer here if you go to layers first edit layers expand this out and let's call this ghost light Ghostlight will only collide with Ghostlight oops everything else can collide with itself with whatever it was but ghost lights only gonna collide with other things that check the ghost light I'll change the light cube to be in that ghost light layer I'll change the well the here's the thing I want two things for this ghost I want the ghost to have a collider that the players can die from hitting and I want the ghosts to have a player or a Collider that turns on and off the thing so this is interesting well actually I think what I'm gonna do is I'm gonna change kill player back so I'm gonna go right in here undo ohh let's let's redo that because no undo undo undo undo go all the way back to being a trigger and then here will re add that check though so say if this that enabled is equal to false return so we still won't do anything on the trigger enter if we've turned off the kill player script on the ghost we're gonna add another Collider so I'll just go in here and I'm gonna add this as a child disable Collider on ghost when the triggers on stay and then make the trigger box bigger yeah it's definitely a way to do it there's a lot of options here so I think what I'm gonna do is just add in an empty game object I'll call this a flight detector so this is just going to be an object here to detect the light sphere Collider on it move that up and then I can kind of control the the sensitivity to light too so as they get as the light gets into the sphere I can turn the thing on and off instead of instead of needing to do it the other way trying to get to pass through only when it's transparent yeah so I'm gonna change the layer on this to be the ghost light layer it's gonna collide with that and then this is me a light detector script I don't want to do that that's already on my I know that's on the pumpkin light so the pumpkin light I'm just gonna check for a light detector and we don't have a light detector script so we'll create it and make a monobehaviour make it public and then this will reference the ghost so just add like a awake ghost equals getcomponent and parent ghost so just cache that ghost from the child and then here we'll call the become I almost feel like being super lazy let's do it public ghost ghost underscore ghost so this is not what I would recommend again in a bigger project but what we're doing here just wrapping the ghost here in a wake on this light detector and then I'll go back to the pumpkin light and I'm going to say let's rename this to light detector I love writers defaults and then it called light detector dot ghosts become lit there we go and then I can just do the same thing down here I'll just rename this here light detector for the type hit ctrl R R let it choose the right one and add ghosts so now the main thing I would say normally I wouldn't want to do this is reffering this ghost public and referencing it again it's a prototype we just want to see if the functionality is fun then we can start doing a little bit more cleanup as we go we don't even need this distance field let's delete that we don't use it always good to delete unused stuff because it just adds to confusion later I don't know if you guys have left code in a project long term and just know that you're not using it ends up being a big mess like you'll end up with a bunch of weird stuff that you don't know why it's there ya don't know what's right what doesn't get used and you end up looking at a lot of code that you don't need Perry the pumpkin is this little pumpkin I don't know why he has that name probably just because he needed a name okay let's add a light detector script this will automatically grab that reference to the thing and if everything works we have some magic we should be able to go through him yep BAM but if I go backwards oh wow so I am I am I never die and there we go so I can die if I was spinning around it would be a lot easier to die let's try that so let's make him rotate again uncheck the freeze rotation a play yeah he's a pumpkin named Perry yeah I don't know why he has that name though okay let's let's make it fullscreen real quick and give that a go maximize on play as gonna see if this is working kind of how I was expecting ah ah not really so I'm kind of able to bounce the room no matter what let's let's debug why that is so if I uncheck maximize on play make these kind of side by side and get a better idea of what's going on there and go to like a 2d view here let's select that light cube and the ghost so that they're nice and lit up so I can see when he's turning on and off and bounce over here so I can see easily when I died that time but okay let's add the timing I think that that's gonna make it a much better thing so we will do is set it up so that he fades out for a little while and then fades back in and then I think that that's going to make it feel better than I can shrink that little area too so let's do it we'll go back to the hierarchy pull the scene view over here and well I see first things first let's go into the code for the ghost where he becomes late open that up and I think we will just use a covert team just kick it off start the process of becoming lit and becoming unlit that make sense I'm gonna do it that way Cobra team or a no let's do it in update let's add an update method let's see and what do I want this to be a if unlit let's see what I'm thinking here is whenever he is unlit as soon as he becomes unlit we'll kick off a timer and then that timer will fade it out I wanted to kind of instantly pop when they're lit and then fade off when they're unlit so say if let's see fade to opaque timer is greater than zero then we'll do fade to opaque timer minus equals time Delta time yeah let's make that into a float now or a double and then we'll say if that goes below zero then if that is less than or equal to zero after the timer is deducted then we'll actually do this stuff so we'll let's let's rename oh so make another method public no private over here let's type it a girl so close finalized and lighting weird name okay and then I'll take this little chunk of code here cut it paste it into there get rid of this random extra P and then we can just set this fade to opaque timer here to like whatever 0.5 we can make that variable so the idea is when we become unlit we'll set the timer if we have a timer value set will decrement it and eventually we'll do that if we become lit again I want to just clear that time arouse I'll just set it to zero you know since I'm setting it to zero here it's never getting into this part where it can finalize on lighting so just keep going until it gets set back and I think that'll do it right so let's zoom it out in case anybody wanted to see all of the code for this script because it's gotten a little large yep I think that's it so no co-routines just kept it nice and simple let's go try that out yeah wait for seconds and a co-routine to just be a little more complicated because I'd have to add an extra code so now he times his fade back in now I still want to do a fade in so I wanted to kind of like animate that that coming back but I wanted to get him just popping first so he does but that was fun okay apparently my stream just disconnected randomly and my internet disconnected randomly again we I get disconnected and then it reconnects instantly anyway so let's keep going so we've got him bouncing up and down and I want to make him do the actual fading so we have the so right now he's doing that finalized I think what it'll do is do the fade in here so if it's less than zero do the finalize otherwise we'll do a fade and we'll fade it to whatever the the fade to opaque timer has left right now it's not going to be anything too complicated so I think what we'll do is take that renderer and just adjust the the alpha color they're just trying to think of how I want to do this exactly so say like a I'm going to go from our current color towards solid white um let's see I guess a that's the thing like a KO routine would be easy to do this into if we just kicked off a KO routine and did a a fade over time sorry getting disconnected from the internet really just confused me and mixed me all it okay so let's see uh-oh if we're gonna fade we should do let's let's get the current renderer color so say render dot color or DEP material color dot alpha okay so that's gonna be our current value and we want to loop that from its current or from zero or whatever it's we're going down to from the alpha color the alpha colors a to the white so sorry I'm trying to think of how we want to set this up so it'd be like a color dot lerp actually I wanted to see that from alpha color to white and we'll do it by the percent yeah that's what am i doing so say the renderers color material color is gonna be this color you know I don't have a percent so we'll generate that float four percent percent will be the opaque timer divided by the max peak timers at it so let's say we had a ten seconds total and we're at five we want to do the smaller number first I'd have to do this okay so do the fade divided by total time which is 0.5 F let's let's make that into a variable total fade time generate a float for that or double 0.5 and I'm gonna make it a serialize field 2 then alt shift remember and up arrow to move that up into place copy that and let's um it wants to be a double let's just make these floats there's really flow float we don't need doubles so there we go we've got a percent and yeah we can fade it I think that's right unless I'm missing something we should be fading from that color to that color yeah let's go try it out I got a double check it kind of mixed myself up a bit but I think that that's right I think that that's gonna give us the fade it's a little hard to tell because there's too much going on here so he's disabled let me just disable my pumpkin go back to the oh wait I can't disable it okay let's just let's go to the pumpkin and I'm gonna disable my light cube and just step through a scene but I want to select this ghost just don't wanna see what he's doing make sure I'm not crazy so step step step step step step step step step he should be out of it he should be fading already why is he not fading is it because I never got the trigger exit that's why yeah I never I never got my trigger exit so let's try that again bounce that's I I need to go through it okay okay there we go now I've exited and I just want to step through and just watch that oh he instantly changed the Alpha didn't he okay let's do a little lerp debug log it and see what I missed cuz I think I feel like I missed something there and I'm just going had to debug it so just do debug that log and just log out that % easy enough let's do a quick jump and go to the console clear that out and pull this up step step step step step step step oh we have two audio listeners okay so I definitely should be out of that light cube right may I made my cube too big no I'm out no I'm not out of it because the ghosts have that giant circle too let's fix that that's probably part of what I'm seeing this weirdness for so my light cube is huge and my ghosts little trigger area was huge too so I think was confusing me a little in fact you know what I'm gonna do I'm gonna show you something else that I would did overdue to debug this and that's disabling the cube completely okay let me stop playing let's disable the light cube for a moment and go to the ghost and I'm just gonna open up the ghost script and we're gonna do this context menu and call this a unlight me whatever I just have to give it a name so adding the little context menu attribute here and just make it so I can just call this while we're playing at runtime and have it happen so I can play and I can just go right click on the ghost and hit unlike me and watch it go through that process the total fade time is so fast I can't see it so let's set this like five seconds hit it again unlike me that didn't seem right right like if we watched it this pumpkin stop moving you're driving me nuts let's see I'm gonna pull this out oh I don't need my main camera to necessarily be a child I didn't realize I'd left it there so I guess I could pull that out I could make the pumpkin stop bouncing there we go then we can do this so the ID setup cinema Sheen for the camera and had it set to follow and for some reason left it as a child so now I can right-click it unlike me and watch it do what it was doing so you can see it went from okay let's let's clear the values in here let's try one more time so my percents are all backwards right like it started at 0.33 it went down down down down down all the way to the wrong number so I've definitely messed up my logic here so let's take a quick peek at it well first let's set a time that's like 10 seconds clear it one more time and just watch it once so you see it still did the same thing it went from 0.16 to zero so I'm definitely doing something wrong here in my code let's take people well first is this value is way off I'm setting it to the hard-coded one this is a timer total fade time see how that fixes it so all I did there was make it so that my my values were way off let's see it's at this back let's go to 5 seconds hit play oh I have my pumpkin still bouncing stop bouncing pumpkin you drive me nuts all right now mover no not that let's find the ghost right click and tell them to unlight and he's becoming more and more and more transparent and then popping so he's going the opposite direction so what I need to do is instead here for my percent I need to do 1 minus that value cuz i want to invert the percents very easy to mix those up or I could have alternated the positions of those colors I guess that would work too but I want to go from 0 to 1 like my fade in that amount alright grab him a pumpkin turn him off grab him a ghost right click tell him to unlight and see if he does a fade in he did so there we go he does his little fade in I still feel like it's not enough it's not kind of flashy enough to see it so let's see there's something the emission is off under fish would you like turn on them turn up the emissive value to maybe like do both oh wait but that's right I think if he was faded out with the emission on he looked really weird right yeah but I guess I could turn on a mission when he yeah let's do that let's see let's go back into the code and just turn that on when he becomes unlit her renew becomes lit - so like rendered mercurial dot and mish where is it oh it's right we have to set the property set proper order the property I don't wanna do this like it's gonna be a mess like what I'm gonna end up doing and I'll probably want to do a particle and said well let's go back into it for a second so actually I want to I want to play it cuz like the whole point of that was so I could play it do the fading and make sure that it was a it was gonna work like that but I turned off my light box so let's turn that back on so the light cube has the trigger it's gonna make him fade off and then he should fade back in when we get in range or after after a short amount of time so I should be able to go through him temporarily and then eventually he becomes deadly again I think okay okay so my I think my light is a little too far bring that in and I almost feel like this needs like some like I need to be able to see you where I'm lighting up like I don't feel like I can see that very well like I can see that the guy became kind of no less deadly but it's it's definitely not very obvious and it's not very clear where - that area is so let's make that change go into the ghost I think the alpha color just needs to go like way way down and maybe I could even change him so he's like kind of let's let's see what that looks like uh-huh make them kind of like red and alpha I wonder if at all there might be a little too much it's kind of close though let's turn that up just a little bit so it's at sixteen I'm gonna like a thirty cool alright well we got a ghost who can bounce through you know want the light to show up better so let's do that next um I'm not sure how I'm gonna make the light show up better though cuz the way I've set up my background UI it's kind of a mess okay I can do something weird with this let's let's add a material here and just make like a transparent little box that's glowing orange or something as a as a light for now going to materials here in our art folder just kind of Auto created call this like a pumpkin light by the way I still think the 2d lighting system is probably the way I should have gone with this after like I've seen some of the demos and it looks really nice looks really cool I think it'd probably be cooler but I just didn't think of it at the time so let's go play with this so give it like something like that like a yellow that's very transparent and set to be very transparent not particularly a fan of the shape I wonder maybe we should try like a building a little shape in pro builder let's do that lets go into the package manager cuz I don't want something too complicated but I don't want a cube either and I just want to show like let's make a really simple shape we will use that shape as our like like kind of like a cone so import pro builder rope it all right it's almost anybody have any questions while I'm building this stuff though or while we're waiting for things to import doing a drink beer um not really not often I mean it did a lot when I was younger but uh I rarely drink now not for any real reason other than I feel like I can't get much done what I do feel very unproductive so pretty much any to any type of intoxication makes me very unproductive so try to minimize and avoid that just because ya get this it feel like you get kind of the same excitement that you can from making and releasing things - it's like a an easier way to do it making a release and stuff is a lot harder but it's also like what works out better I've definitely had times I remember the worst one was when we had an event at Sony so you have every now and then we'd have these little parties to celebrate something and we're gonna go in and make a new shape by the way so we have parties to go and celebrate something you know like a launch of a game or a launch of an expansion or something that went on one of them were outside just you know it's like noon they bring in a bunch of kegs and food and barbecue and stuff and we're eating and drinking and no around like for we're kind of done things are wrapping up most people have left and no I'm waiting for a ride home because obviously I'm gonna drive because been drinking the whole time and started coding so went in and were like in there me and Mia moaning my buddies when they're working on some stuff coming up with all these ideas coding some stuff up and come back in the next morning and looked at what I had done we were also doing all kinds of other crazy stuff but looking at my code and like all kinds of terrible I spent more time I think deleting and trying to clean up the the weird nonsense that I'd made so it was when I learned that I can't drink and code anything that's not good that's gonna work or that I'm not gonna have regret much later and every time I've done that that's pretty much what happens all right so so we pulled in pro builder I want to open up the pro builder window if you haven't used pro builder before it's just a cooler tool for building shapes and things in game um I use it for don't coder art some artists can use it to make real things um that's not me I can't quite get there but we can just make a little shape here like our cube and put it into position gonna line that up and then we can take the side here or here let's get rid of let's just disable that thing let's work on my cube so go to the cube and I'm gonna grab well first let's scale it down just a little bit and then I'm gonna grab this face here so I can take like if I go to the face selection mode I can actually select that little face right there that you see and I can grab it and I can drag it out I can also scale it up this I can go Boosh and like this and make see how I've got like this weird spreading out camera frustum cone shape now I can do that and I can drag this out more I can kind of stretch it to the shape that I want and I was thinking something kind of like that maybe and maybe even smaller at this base so I'll select this face and I can scale this face down hopefully you guys are seeing how cool Pro builder is to just make these little things move tool ups I don't want to move that so right now I'm in face selection and I hit move I was moving that I'll go to object selection mode and I can move the object kind of into the place that I want and I want it to be basically where the light cube is so here let's reset that transform position move it out here scale it down a bit it was definitely too big and maybe up and in there and then we'll give it that weird pumpkin material and see how it looks there we go not perfect but I think it's a certainly better than what I had a minute ago all right so we'll take the light cube and I'm going to move that pumpkin light onto this one and see do we have anything else here I just had the collider and the light cube I'll call this like a light cube - it's our new version of our light cube are we good there did I miss anything we've got the script I don't this should work and now I can see things okay but now it's not working why is it not working so the light cube is hitting the things it's shooting out my eyeballs but the collision isn't happening what did I miss here on the collision what's different they both have a material this one had a box collider that's a trigger this one has a mesh Collider that's not a trigger so let's check convex and trigger and see if that does it bounced over here again mm what did I miss there I'm not sure what the problem is let's see is it because convex triggers aren't gonna work yes I haven't tried that what's the problem here if somebody asked for us from state wise California just down by La basically which is really nice hell of it not right in the city far enough out of the city that there's lots of space and it's relatively quiet but I can also get to the city and anything that I want in a relatively short amount of time why is my light cube here or not working anybody have an idea anybody know what I missed here let's see I am not sure what is there what was the problem yeah let's just turn on the other cube to see so it's okay that's just weird um I don't know why that cube is not working for the collision I'm gonna just move this script back over here for now oh the lair thank you see this is why I hate layers that's so easy for me to forget yes that was it I'm almost positive that's it so let's go yep there we go but now it's not visible because I made it not show up and render okay that's interesting so the rendering is happening in the background and then the light how do I want to do that let's see let's uh hold on one second guys [Music] all right so let's duplicate this one because I want to be quick with this and we'll put this one on to the default layer disable the Collider and the script and I'll just remove those so then we'll get the visual on one copy of it and the actual interaction on the other let's call this light cube visual on me and then this is the collision only so same mesh twice whatever it's fine hit play will bounce around there we go thank you for calling out the collider put the layer Wow Wow nice okay so that's fun I think I want to do one other change to it too though I want to make it a scale out I feel like it should like get bigger and smaller that light OH first let's just move it in let's grab the two I gotta grab both objects now I'm gonna actually make a child for him okay let's get so created an empty let's call this light cube I'm gonna move it to wherever this is reset everything and then move it out and then make these two children of that mostly because I want to move this thing around and I don't want to mess up and move it separate from the other thing there we go get them side by side and just kind of see where that oops wrong one let's grab the blue okay let's try grabbing red grab that there and I feel like this should be back over this way a little bit more because I don't want it sticking out in front of his face change it to have this chute have him shoot from his eyes oh every cool too so let's see we've got a got him showing up there I feel like this should be like a sphere or cone though like that shape is just weird and we are in pro tweed a pro builder so let's even change that real quick just because I don't like the shape so go back into pro builder one more time tools pro builder window go to that new shape tool let's hit the plus bring up the shape selector tool and add a more does it a prism no it's a prism the what's the point at cone the pointy type thing right and then give it a more sides so it's a lot more rounded yeah I think that's gonna look a little bit better for what I wanted and give it a longer height a slightly smaller radius yeah I think something like that might be good so let's hit build and I got a cone drop it down under my light cube and reset that rotation oh not that one this one nope not that one there we go set that to 90 on the z move that sucker right up there yeah let's see how that looks not very smooth but let's see if I put the the material on it how that looks pro builder default which one was it it was our pumpkin light yeah I don't know I mean like I said it's not it's not perfect either but I think I feel like it's a little bit better it feels more rounded and less like a weird cube so let's see I'll take my cone and duplicate it make a cone visual and cone collision because again I'm just gonna keep them separated and set that layer to ghost light as for the rendering and take the script here the pumpkin light one and just drag it over to that cone collision disable this one and then this one was just a visual right so I could disable that and you think we're good now I can move this guy up a little or hey let's move it up and then back I want it just there I think that's good good enough alright let's play one more time see oh crap okay let's disable those all the extra stuff that I've created let's get rid of those extra two cone lights get rid of these extra two cubes that I just randomly threw into the middle of the scene we have anything else where's that other cube coming from oh that's the pro builder window so when you open the pro builder window you get that little blue preview of the thing that it's gonna create and that's what it was showing me there alright so there we go what why did he not turn off or did I miss this time oh I gotta check the the boxes on the on the collider right so this needed the convex is trigger and play there we go so now he turns off I can get through him [Music] I think the turn off time is way too long obviously oh and they stop moving when they're turned off that's an issue why did he stop them stop moving am i turning off that whole script the moving one then move up down no let me see what else so he stops it turns off the kill player now I don't know why you stopped that let's let's check it whoops I've died oh and our ground I accidentally deleted the killer ground area okay so hit that guy he's ghost he comes back and if I hit him again he'll kill me okay let's add a bunch of ghosts and see if that if it's even any kind of hard so so far I've just been playing around with goofy mechanics I have no idea if it's actually gonna be any kind of fun in a in a actual level so what I want to do is just try to do a really quick set of level building so let's uh let's save this off let's see it where's my killer ground cube oh I like that in a minute so this is our player I'm gonna rename this the player and then let's let's just clean up the scene a little bit and pretend that we're doing something real because we're gonna build out a level having it somewhat organized is pretty helpful and or make this a whole lot quicker let's call this environment let's now put some square brackets around it and then I'll make another empty one for ghosts and I'm just gonna reset the position on both of those cuz I want these to be zeroed out they're just gonna be transform routes for our IR key take the ghost and just drop them into there and then we'll take these platforms and drop them into the environment background camera I don't know I'm trying to think where I want all this stuff this will go into environment the directional light is really just general environment stuff see what else do we need remove these things cut up out of the way the canvas we're not actually using so we'll delete that and we'll delete the event system oh wait no we are using we canvas apparently I used that's right I used the canvas for the background okay let's create a background object - so create empty background hit reset and we'll take the canvas and the background camera and just drop those on there okay I think that's good so that gets us to a slightly cleaner version of the stuff now let's actually make make a little bit of a level here so I want to start them off no ghosts on scene so first goes to be kind of over here somewhere so start with bouncing and first challenge is just get to the second platform right it's like bounce a couple times and bounce over to the next platform once they've done that bounce over and bounce to a slightly higher platform and once they've done that maybe at one more regular bounce and then they practice bouncing down to a lower one let's get these in order to put them in the order that we see them in so this is right here and then this one goes right there so then this one would be like hey they bounced oh wait no this was they bounced over and then this one I was actually gonna move over and have Mike bounce down not a lot of fun yet then would duplicate another one and have them bounce over a ghost so that would be like step one get here and bounce past the ghost and it would do another platform over here and maybe another ghost in another platform cool let's try that see how it feels oh actually I should do maximise on plate let's see I so good game maximize on play and play there we go bounce around oh we're already starting to spin ah wah boy and Ed that was a fail okay let's put a ground down there too so game object will Riyadh that ground cube Oh delete that go to game object 3d objects and cube set this to like negative ten we'll make it 500 wide and you know whatever 10 meters deep doesn't really matter and it will give us the kill player script and I'll leave the renderer on for the first time we hit it then we'll just turn it off after so if we fall down we should see that okay see we didn't see it so let's go to scene view and find out where that cute white oh whoops I put these in the wrong spot position is gonna be 0 that's gonna be that and yeah so go to 0 and 0 now if I go to the object in the scene view there we go that's closer to what I wanted but I want it I think probably down even lower right where's our player actually no looks like it was in a decent spot so right here that's our play area so if we fall down below that we should die let's turn off the ringer save the scene one more time just fall in follow our death real quick OOP cool so now if I bounce forward I should be able to try to ah okay if I can make it ah this is actually not very easy okay I was actually I mean it's not overwatch but it's pretty close right like yeah it's neat neat fun little mechanic I'm actually kind of cool I mean it's not great by any means but I think that I could do something kind of useful with it so let's see let's say I'd take that let's hit W duplicate it and maybe I make it so you have to jump up here and then duplicate it and you have to jump up here somehow and then over here yeah let's let's say they have to jump up and get past some ghosts so take this ghost and duplicate him and maybe put like another version of him up here so he's up a bit higher in another one like around here it seems like it's going to be extremely hard but see bounce around this be easier with a controller by the way I'm sure ah there we go we hit that ghost and we have a couple seconds oh yeah I think I left that timer way too long for how I'm Oh think I'm gonna make it I'm not very good at this and roll to my death uh that's interesting I feel like I should just deploy it and let people place who anybody have some other just little ideas and stuff we can add real quick I really just kind of want to prototype out some basic functionality play around with it and see what it was like and also show that process of like what it's like prototyping and how much detail are kind of go into and you know what kinds of things you know little compromises I'll make back-and-forth when we're making these changes to to make stuff fun and figure out what's fun and do it quickly so if you guys had questions about this stuff um like them know if you have some suggestions or ideas somebody did ask about how to make a network game it's dramatically different you need to I would say first prototype out the single-player version of it make sure that it's gonna be fun and that it makes sense because once you go to multiplayer like it seems like it's gonna be two times harder in reality I'd say it's probably ten times harder if you want to make a network game versus a single-player offline game it's so much harder especially to get started if you know how to do it you've done a bunch of network stuff it's not it's only two to three times harder but if you haven't done it before expected to be you know ten times the effort let's see simple collision sounds that's a good idea Jason and a ghost that follows you so you can't go slow not a bad idea and the role should be time so the pumpkin always lands that's quite a bit harder but let's let's do the other things I mean it's not a bad idea so the pumpkin lands right but um it's just I think it'd be a bit more complicated to figure out be neat polished things so let's do uh closing sounds and then just following you because those are both very easy so we'll go to the mr. player and he's got a Collider here we'll just let see I don't want to set this up I'm gonna do it on the collider yeah let's do it so we'll just do a bounce script let's call it a let's go into the ghost and go to the bottom of it and say public class bounce sounds monobehaviour on collision inter will play a bounce ound and to play a bounce ound we'll just pick a random sound from a sound array say int index equals random die whoops not that one why random I want the unity engine window so let's go up here get rid of using system for a moment dot range 0 comma bounce sounds dot length now I'm messing up my using statements up there because I'm working in the same file so I'm just gonna move this to its own class and go back to ghost and make sure it's good it might need that using the system statement oh maybe not okay that was extraneous nonsense cool so let's add bounce sounds it's gonna not know what it is but it's gonna be an array of audio clips so just say like audio clip array and we'll make that a serialize field and then we'll play a random sound so to say uh audio source top play bounce sounds I or index created an audio source field and I'll just cache that in a wake get the audio source component cool so is that it oh it play one shot that's what we want not play um yeah and then let's Jason had mentioned throwing in some random pitch adjustment so we do that just say audio source dot pitch I'm just gonna copy this code it goes random dot range 0.8 F to 1.2 F so there's just a nice simple way to add in a little bit of variety on those those sound effects let's do that so we've got our bounce sound there got bounce sounds array and just add a little check here so say if length zero return all right let's do a log-log an error no bounce sounds signed and I want to get rid of this I really hate when it does this when it adds the random equals unity engine dot random crap it happens when you have system dot random in unity engine dot random there and it tries to add it to clarify thing I hate it okay so we've got our bounce sounds there let's go into the player we should be able to just add that script and then add some sound let's add in some bounce audio clips anybody you got any good audio clips for bounces I'm gonna search for the word balance or audio and see what we can find yeah let's go to free I just need a little Boeing sound or a couple um we're out pricing Oh interesting there are no free audio options for a bounce sound interesting go to audio hoe and sound effects and see what we can find here let's I got to make this fit a little bit better this window does not fit well at 1080p alright collapse 2d I'm not select 2d unselect it and go to audio sound effects let's see what we can get some sort of a free a little noise casual game sound effects that sounds right Oh see Tesla Volta games asked is it harder to do a 3d action-adventure single player on the game or a 2d multiplayer game that's real time or turn-based 2d multiplayer by far a multiplayer is it's just way harder there's so many more things that you have to take into account versus when you're building a single player game single-player games like once you built multiplayer games a couple times single-player games just feel really really simple so I would say always single-player is almost always gonna be easier there are probably a couple scenarios you might be able to pair down something really really simple on 2d and have a really complicated 3d thing but in general the that the multiplayer part is the hardest ok let's see which should have got some audio somewhere where did they go casual game sounds I like blind let's hear some I've been I can't hear anything okay I was playing in the editor I don't can you guys hear the sound that was an odd one trying to find a good bounce three might be okay five might be okay is this like thunk sound no know that a lot of these would look way too long let's see first one that might sound like a they're trying to find a good one here maybe one of these yeah let's go for that 21 - not not a perfect jump sound but it's a sound so scroll down if we can or just do the scrolling take 21 and drop it on there what's 22 let's take 22 on there - I don't know what it is there we go I've got two different bounce sounds well it's a play and see what happens oh actually here let we had two audio sources on so I want to turn off that audio source on the background camera real quick the background camera audio listener I mean I'll just remove that we don't need to audio listeners let's hit play one more time yeah oh should probably make it actually call wait why isn't it calling isn't it set as a on collision inter bounce sounds plays on collision enter yeah what's happening here why are we not getting our bounce we are colliding right let's let's log that we hit something real quick I'm not sure what I missed here so we're gonna log out the thing that we hit this is the string interpolation the dollar sign thing though if you haven't used that it's awesome definitely the best way to mix in your strings or at least the easiest let's try it again I want to see what's happening there so I'm bouncing and it's let's uncheck maximize on play game view Oh mute audio is on that might have something to do with it oh and there's no audio source you can see the error right there in the logs sometimes I just gotta look at it so let's go to the player again claps claps claps let's add an audio source I should have added to require component audio source to bounce sounds and I wouldn't have had that problem there we go the sounds are very different or doesn't like my mesh my cone visual by the way but that's okay we're not using the collider on it okay well one of those sounds sounds terrible the elephant sounds less terrible I'm just gonna go with let's see which one was it that was I think I like 22 more than I like 21 which is kind of funny the 21 one is to to chill alright whatever I'm gonna stick with the one sound so it's go one sound picking a random range and it'll bounce and make the noise let's make a ghost that follows yeah for this I feel like it needs pumpkin splatters every time it like like little pumpkin pieces needed to go flying out whenever it bounces to like he's just falling apart but I want to get in that other ghost so let's see we had blue ghosts and I think there were some other ghosts in here some other colors let's just add in this orange dude and we'll make him be the guy that chases you around so I'm gonna drop him under ghosts rotate him negative 90 and then let's turn him into his own new prefab just like I did with the other one oh I didn't do that with the other one like I thought I did I did it with the platform okay well let's see what do we have on our ghosts so our ghosts have a ghost up down a ghost and to kill player in fact you know what let's do this um let's do this in a better way let's do this like we would if we were using prefab variants because why not we have an opportunity to use them now let's just name this blue ghost alright yeah actually my name is ghost it's just standard ghost I'll drop it into prefabs and call it pull it down my UI is a little different because I'm in 2019 point 3 beta so I just grabbed the one of the latest betas and with that also why it's doing that weird flickering in and out thing so I've got my ghost here and I'm gonna make a variant of him so I'll take the ghost right here right click and hit create and then we want to make a prefab a variant where's that option in here prefab variant that's right underneath me so let's call this a chasing ghosts so he's gonna be very much like a regular ghost except he'll chase you instead of following oh no downside of a beta right it just blew up and crashed give it a second cancel go ahead and die or reopen unity and then we'll go from there once it reopens let's see open up that project and let's see hopefully we can keep going letting it load in and we'll go back into our sample scene cool okay so we've got our ghosts again let's go back to here we I think I may have lost the prefab though when it blew up up note we got a ghost and we got a ghost variant I don't know if this is gonna work though if everything's just gonna die so let's change out the material on this variant first so we'll expand out and find the myth or the toon ghost and we'll swap out the material here with this one so now we've got a different material on them and I need to change the behavior so we need to change get rid of this up down and do like a ghost chase or maybe we'll add a ghost chased script let's do that let's say ghost chase now we'll open it up and then in here we'll go like let's find the player and then just chase the player so maybe on and Abel will catch the player so say player equals find object of type and we're just gonna find it we're not going to keep a reference to it or anything like that because we just don't need it right now and we'll find the mover because that's the only thing that's on our player you know create that as a field normally what we're gonna do is have like some sort of a reference to at a single 10 or some some way to get to it but um you know so our YouTube is apparently not getting enough video quality that's weird giving me a little error hopefully it's still streaming through though next we want to move towards that player pong one second though alright last thing we need to do is make it so that it follows with the player so we got the player and we want to move towards them so get the direction to the player switch the bar direction to player and we'll take our current position - the transformed up position - the players position and then we will just move in that direction so to transform dot translate and we'll go in that direction oh we want to normalize it though so do a let's just do direction dot normalized x movespeed and we'll make that a field to realize the field give it a value up I think we're good and get rid of those using statements and I think we're good yeah yeah I did somebody mentioned started stream more often yeah I'm just doing them a bit more they're kind of fun just get to go through and answer questions and build stuff out I think does it so we got a ghost chase I'm gonna leave the move up down part on him cuz I think it might be interesting it might be terrible though I'd be moving weird all kinds of craziness and we should probably move the movement stuff out of updating to fixedupdate but um I don't haven't done any of that yet again just prototype so let's put this guy right here and hit play and see what he does not exactly what I was thinking we do I think I might have put my data put my direction backwards tends to happen oh and we want to multiply by mu speed or combat death time let's try that again apparently we're getting lots of streaming issues I don't know why see where'd that ghost go okay there he goes now he's coming towards me but he's still going up and down so I still have oh and his Z position is way off why is the Z position off ghost variant Z is at zero what is my Z for the player zero zero I'm very confused why did he move along the z axis let's hit play again and pause okay so here's that that he's just slowly moving along the Z I'm really not sure what I did here he should be moving towards me oh I'm using no did anybody see what I missed here why he's moving funny I'm not sure what I did I think I've been looking at the screen for too long but he's moving along the z axis and we're just getting the direction this should all be zeroed I don't know why that's not zeroed I'm just gonna zero it for now let's save our Direction equals new vector3 of direction to player dot X comma Direction to play about Y comma zero because I'm not sure what's happening there and I don't want to figure it out right now alright one last time go in and hopefully we have a ghost that chases us now let's see I think he needs more speed no what the hell did I do wrong here guys I don't see anything in chat either I was waiting for somebody to give me the magic answer to see what I missed I know I'm obviously looking at something wrong and I just don't know what is or why I'm missing it so if anybody's got a thought I do still have the ghost up/down script attached but I think that should break it right here let's reset the position on this oh it is it does break it why does it ghost Oh cuz they're both moving it okay yeah let's so let's stop playing it's very good point so if I remove this from the variant and just use the ghost chase script that's - yeah and yeah I probably should do do the movement in fixed update I mean I definitely should here like I said the prototyping and getting a little sloppy so it didn't yet but um yeah it's still weird why the hell did it do that even without this chase script on it's still it's acting strange and I literally I'm just not sure what I did wrong give it some more move speed why is it moving on the z-axis sorry it's bout ho is it bouncing really loudly for you guys - yeah I guess I'm not sure why the Z is changing what have I done here is it it is it's because I wasn't thinking I think it's the rotation and the use of my my use of translate a little frustrating happens okay so I died again oh I'm dying because I reset it when I reset to zero it goes back in that kills me I was like what is going on there okay so let's change that to Sarah that's the problem it's the rotation it was completely my fault so I'm using translate and forgetting that he's rotated I'm just gonna move the position I'm going to be really lazy with it so I'll just you transform dot position plus equals and we'll just move it by the offset amount now we'll just combine all that so that I think is gonna fix it I'm it we're gonna end up with some weird stuff the mover is on the player there we go that's better that's more like what I was looking for of course we're not moving it with physics now and we're gonna get some other issues do we have the kill oh and we're turning it off okay so let's see the other thing we need to do is with this ghost variant I think he is getting turned off by his light detector but he's not showing up as invisible because of the material that we have set so it's set to opaque and it only works with fade there we go perfect so let's expand that back out I'm gonna set this back to fade and now it should act like it was expecting I think what was happening is it was kind of working but I wasn't seeing the visuals for it so there you go now we've got a ghost that follows his movement speed is way too high though so let's turn him back let's turn down to like a point five and save and play one more time if anybody wanted the code for this to like I mean obviously I can't share the art assets but I can zip up the code okay I died I can zip up the code folder and stuff and send it off I think I'm gonna just kind of wrap up the the building of the stuff right now and take a couple questions real quick before I kind of clear stuff up and go do all the other things that I need to get done for the day but um it's definitely turned out more interesting and fun than I had expected have a lot of fun kind of putting it together so anybody have any questions stuff you guys wanted to ask about real quick before I kill this thing and yeah do whatever give like two minutes for people to type stuff in as I bounce around man get my no kids playing pumpkins sorry so okay let's see questions do we have anything our team works on 2018 thinking of migrating the latest one what do you think about 2019 I'd say definitely if you can migrate do it it's worth it there are a lot of benefits and there are a lot of cool new things coming they're gonna make it even better so I would I would go for it we did it for a lot of the projects I'm working on and anything that you're gonna work on long term keep it up the pumpkins bounce is actually really really simple it's just set up with a physics environment or physics material so we've got a rigidbody here just set up normal and nothing's nothing's changed on it at all really other than freeze position on the Z so it doesn't go back and then it's got a sphere Collider with the bouncing material which just double-click on it you see how the bounciness of one and a friction of zero and the bounce combine is set to maximum and make a physics material just right click get create and find physics material somewhere here and you just set those values they go from zero to one the reason I use transform dat translate is I normally do it don't normally move things with position if I want to use physics I should probably be using the rigidbody or translate and just moving things right is just getting lazy with it because it's not gonna make a difference for this game because I'm not going to work on it water let's see what other stuff we have here did the video on best practices then you introduce an empty game object for holding an actual character oh yeah definitely that was probably if I hadn't gone and just done the sloppy code of moving it I'd probably put it in an empty game object and then have the thing facing the direction that I want part of it is that like I want them facing a direction that wasn't their normal direction from the models so it's probably what an empty game object and put the visual underneath it and have everything else somewhat separated what are the first steps when designing a new game do you start with the design jump into coding the prototypes fast possible or plan I start on paper usually I'll write down the ideas or on a whiteboard talking with other designers come up with a general idea try not to get too into it but try to figure out like what the possible fun things are and a couple ideas for how it might be fun and then go into prototyping and just start building stuff and see what actually works and just figure out those core mechanics like is the core mechanic something that I could see is interesting enough or that inspires me enough to build something fun out of it let's see how polished should a vertical slice be when pitching to publishers that I don't know I think it you know you have to be talking to a lot of publishers not something that I do I don't generally pitch to publishers um I know a couple guys who do that a lot and I might be able to get one of them on to just kind of answer those questions I know they usually like to be relatively polished and pretty nice that they want to have a fun experience that shows the quarter loop and is really polished and they're usually trying to pitch like we need to scale this up now right like we've got this little three-minute Chunkin we want to build it into a four hour game or whatever let's see what other things that we have when did you first start learning how to program and what was the first language you started with out of curiosity I started with basic and I think the first thing I ever coded on was an Amiga something it was my uncle's or Commodore 64 i'm not sure which one it was both around the same time it was just writing stuff and basic and I was kind of forced to do it because I didn't have many games I had three games for the Commodore I really wanted to play other stuff after I beat all of those so I started trying to figure out how to make my own games and I did a really terrible job at it made a bunch of simple little text things and got really excited when I was able to draw stuff then I played with game maker and eventually stumbled into C++ learned a little bit of that and did a lot of c-sharp and then back to C++ for game development and then c-sharp it pretty much ever since I stopped doing unreal stuff so let's see what other questions is it common to create inheritances yeah I mean well it depends like code inheritance I try to minimize like don't do too many layers of classes and base classes I'd go for more of a composition model than inheritance there but game object variants and stuff I'd say are getting to be very common now something that you should definitely look into because the nice thing here like I made this variant this for this ghost I didn't show that if I change something on this other ghost like I change you know the way the the ghost script works the total fade time say I want them to all be two and then I go in and apply it to all its gonna apply to this other ghost here oh wait it doesn't I expected it would have applied since that was the base prefab now I'm a little confused total fade time oh oh no I have to I think I have to go on to here that's right and choose overrides and interesting I'm not sure why it didn't pick it up I don't know if that's an issue with this version of the beta or something that I did wrong and I somebody said I look tired yeah I don't sleep that often and I didn't do my my YouTube makeup for the day yeah get all nice and made up skin but yeah I I actually am pretty oh somebody else said they started basic on an old 386 I did a little bit on the 386 - that my friend had it was a lot of fun the first time I really got to do a lot of coding like where I wasn't just you know an eight-year-old that didn't really know what I was doing was when I got a 486 and I started doing basic stuff on that and then a friend of mine started doing C++ and that was you know what made me learn the C++ was the thing that I should learn it I was still terrible at it at the time though let's see what other questions did we have oh good Jason's answering some questions in chat too if you're curious about publisher stuff he's yeah he mentioned a chat Talk the things I hate about your game pitch from GDC I saw that talk it was really good and he does kind of explain you know a lot of people a lot of people think that their idea is you know worth the billion dollars because their idea in their head isn't just their idea it's like the thing is built the company exists the game is amazing and fun and it has all these little things in it um the idea is really generally worth nothing it's all that execution and you've got to be able to execute and show them that you can execute but you also have to have something that's more than just an idea because everybody in the game industry has dozens of ideas every you know every office that you go in and work at and it happens a lot of time with new people coming in right they'll come in like alright I've got this idea I'm gonna change the way that we do things at this company and my idea is gonna totally change the company you got to remember that like everybody else that came there or almost everybody else that came there is the same thing they all came in with a dozen ideas and they've all come up with you know probably a dozen more ideas while they're there and getting them to want to build if your idea is not an easy task then that's not something that like you should expect is likely to happen especially not at first until you've built up a lot at the company and a lot of clout there where people are gonna agree that your idea is good yeah I ideas yeah you say their ideas or cheap execution is everything exactly the truth right there are good ideas out there anybody can come up with good ideas how you execute on them as important it is awesome not to say that you can't have bad ideas you could definitely be a designer that comes up with terrible ideas right I would I wouldn't count myself as a game designer with good ideas really have lots of ideas or I don't know that any of them are good enough that we build a game or invest a lot in them at least not the design side let's see what else we got here any other questions can you make an open world game in unity or is unreal better tool for that is unity a resource hog I like c-sharp more than C++ yeah you can definitely make an open-world game in unity um I've seen a couple being built and I know of a couple that are in progress now the size of the world that you want to build obviously makes it more complex but and it's not gonna be automatic in in either engine where you want to just build out a giant huge world you're gonna have to manage that you're gonna have to come up with a strategy for loading and unloading things the new addressable system makes that really really easy though so I don't think that that's a huge task anymore or as huge a task and the new terrain system looks like it's gonna make that a lot easier too if you want to make a big outside open world I haven't used the you turrent new terrain system in a real environment yet but played with it a bit and it looks like it's kind of built to start solving these problems and I think that there's really I can't think of anything that you couldn't build in unity that you could build in another game engine there might be something out there but I haven't seen it yet and I haven't seen a reason to switch away ever since I switched the unity had just been it's been getting better I've been liking it more and I've never really run into anything that was an issue any other questions it looks like that's it um and yeah like I said I am looking tired so I should probably go go rest a little bit and then get back to stuff if you guys have other questions just drop them in a comment below I'll try to check them shoot me an email I've got a giant backlog of emails trying to catch up on but I'll get to him eventually just my name at the unity3d dot college and I think that's it yeah all right if you guys want a copy of the code if anybody drops the comment that they want a copy of it that's fine I'll zip it up and upload it without the art because they can't send that stuff but um yeah it's fun stuff okay there a couple other questions I'm gonna just take quickly somebody to try it out spatial OS it sounds promising trying out the FPS example left them with problems yeah I haven't played with spatial OS yet it did look really interesting it seemed like a neat idea to build certain types of games where you want to build like a giant scalable thing and it seemed like a service that I want to build like I actually tried to build something somewhat similar to that five years ago for fun cuz I thought it was gonna be a really interesting thing I never finished it though cuz I found all kinds of other issues that I hadn't thought about when I was going through the process but it's not my like to play with more I should probably talk to Charles about that he did a lot of videos on it and getting to give me a quick run through on how to how to use inbuilt something and how long do you take before designing before coding is it normal and take a month no I would take a day and design out the core part because it depends if the whole game is a story this might be different but for me it's usually about the gameplay and that core functionality that core bit of gameplay loop get that figure it out design it in a day play it iterate it and just keep iterating on that until it's fun and then build out the game more from there it's really easy to build out like a giant thing like this whole huge progress or project and a plan for it and build that all around a mechanic that's just not fun like you build all this stuff and nobody wants to play it because the main thing that you're built around is like me nobody cares right so you want to make sure to get that part right and then go on from there oh yeah somebody asks about you doing udemy stuff I just it there are some issues with it the only reason I don't do you Demi stuff I just do all my stuff myself on my own site just that game dot courses and yeah somebody said maybe ninety percent of mobile games were made with unity so unity is like Windows that is true it's not I don't know if it's 90% but a large percent you know more than half the games made for mobile are made with unity and probably more than half the game is made for PC or made with unity now I I don't know the actual numbers but I'd be surprised if it wasn't just it's so approachable it's very easy to get into it's really easy to find developers and hire developers for it much easier than any other engine really in my experience it's like you can if you want to find a good Unreal developer it's not gonna be nearly as easy as finding a good unity developer and part of this just cuz unreal for the longest time you know it was half a million or a million dollars to get started that was the entry unity came in made it free to get started and just people kept going with it and that's why everybody started switching over to the same the same situation that unity had where you can get in for free you can start learning it for free you don't have to spend a million dollars to learn how to work on the project right so that's I think part of the reason that it's been such a big powerful engine and such a powerhouse and the reasons I love it anyway um thanks again everybody I don't want to keep going for too many hours like we're at 3:00 now if you guys have questions up I mentioned my email and if you guys don't mind if you're still here just hit like subscribe or share or something just so that more people see the stuff and and know to keep doing more of them as for next stuff I think I'm gonna do another stream tomorrow with Charles or Rocco not sure exactly what the plan is I got some other recording to do and get back to a couple videos that I want to get out but um I do more and we'll just talk about random other stuff answer some questions and I'm not sure what maybe one talk about spatial OS that would be fun alright thanks again bye everybody
Info
Channel: Jason Weimann
Views: 31,719
Rating: undefined out of 5
Keywords: game development, unity game dev, unity game devlog, video game (industry), unity devlog, unity game development, game developer, game development unity, unity3d college, game devlog, how to make games, unity tutorials for beginners, unity tutorial 3d beginner, video game industry, unity 3d, game dev
Id: 3rYekhuWF_k
Channel Id: undefined
Length: 175min 4sec (10504 seconds)
Published: Sun Oct 20 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.