Transcripts
1. Creating Obstacles for our game: Welcome back in this video, we'll create our trust in me instead, the game. A search for their We haven't for their with a name called Enemies, which contains all the and middle aged spreads. Open flying at me folder and drag the playful a one sprayed and go again The inmates Bread is small Commodore player. We can adjust the dimensions but changing the example Unit for image. So select the spread in the flying in me. Fuller and Jane, the pixel per unit. Value to 50 and click on a play. No, this looks good compared to over player. So let me rename the object. Oh, flying in me. Let's add an animation for this enemy. So open animation we look with over at me Object selected in the hierarchy. Click on, Create and save it at your preferred location. Inside those heads folder, I would say we don't know the animation folder that we created a Lear. We'll create a new full of our enemies given name for the animation clip. Once you say the animation clip dragged this prate into the animation we know to create an animation, we will use the new Sprite, replacing them after every 10 seconds to make it look smoother. No, When we play the animation the in May and wish it looks good, let's do no. Let's do the same for a second and me dragged the slats lame and me do again. Change the name to Slim Ana. Remember toe change the pic Simple unit value to 50 and then a play. Do it for the second spread as well. So this is a ground and me, so we will place near to ground. Finally, let's create a new animation. We will add its lighting any mission, Save it at the same location. No, drag the spreads into the animation window, chaining after every 10 seconds similar to over playing in me. So let's click on play. Yeah, this this looks OK. No. A coordinated collision with our player. The enemy object should have a color component attached. She'll select the flying in me and added books color competent. So both fuller Torrey. You can edit the coroner to make sure that it's or left their spreads. Exactly. Also, add a boxcar letter toe over slamming me as a time for you guys. You have to create it out in the object This name You can find the sprite in the snail folder Inside that in before let off Gammas! It's dragged into your game. I, Radike does the pig Simple unit while you make a sliding an emission. And also had a book square to the competent, as we did in this region. So let's do this. Onda, meet me in the next video.
2. Creating other obstacles: who you were able to create The last enemy answered the animation and auto and the books called a company. It's not. No problem. Just follow along. Dragon Rubley, snail Spread into the scene. I will change this big Excel per unit value to 50 and then a place. Then we will create animation. Create a new animation clear soon at the same location that we're the bear but that this enemies dragon drop the spread into the animation window and chained them up there every 10 seconds. Since we have only one animation for all these enemies, this animation will replace all the time. Andi, this animation will with the default admission. And we don't need toe make any transition in the animator window. Let's two objects which will act as obstacles in our game. Instead, the obstacle folder Drag this spike sprayed into your scene. The size looks good. We don't have retained the acceptable unit about you. No, I had a books quarter. So the company into this came out. Do the same for the second obstacle. Drag the spread into the hierarchy, add a box connected to the component to it. Uh, just a quitter toe my store object. Okay, I forgot to add the cooler part of a snail object. Let's add No, no, we're done with the mission. Set up put up stickers And in May of just this one, we will make them as prefect. After adding woman script on, use them to randomly instead shirt in our game. So one final modification for the for all over object in me objects select all the n mi objects on enable the east trigger pull in the cooler Competent. This is to make sure that our player doesn't stop or fallen When collated with this subject in the next tutorials we'll start working on moving other and meal on death through script .
3. Moving Obstacles through script: Welcome back in this video we'll start working on moving over in my optics. So inside unity In the script Fuller created. You see Shep script and name it as off the moment. As for over design, over in me game objects stops are gets created and that I'd said a home screen or outside the scrim on more towards the player at some speed. Let's do that. We will legally speed available. That began a red from Inspector No. Inside update Minton. We use the transit transformed or translate meter and has the duration. Since we are moving towards the left side, we can use the rectitude out right, which will point to the towards the world right direction and multiplied by a negative one to get day left direction. Andi, do this. We will multiply the speed value to make it more faster Since update Since a blood runs every frame, we need to multiply by time. That does that to smooth the moment off. Yeah, no, sir. This group back to unity. Let me disable all other objects and use the flying object for testing. Dragon drove this script. Do flying in me, move the enemy outside of the screen and said the initial speed value off click play We see our after displaying from, Let's say, to write. But the spirit is. But hey, let's read music and try again. You can adjust the spirit to me. You a game using No, Let me and the script all other game objects on Give us beautiful people and fight. I want to randomly create the meal dicks and move and make a prototype for our game. Let's make prefer about this game. Object. So inside the assets for creating new folder call it as prefects and dragon drove the objects to make the mess prefer. This will make them as prefer, which we can use, you know, game as templates. No video indexing the hieratic No creating news group limiters off the creator. This clip will be used to create n mi game of dixit Rent them. We need a reference of the objects that we need to create Ed rounded, so we will declare an array off game which we can set the prefer bears reference from the Inspector. Let's create a new corden mentor which gets scored every two or three seconds. We will create a game object from the list off the objects we save in a way we can use the random short range. Get a random value between zero and the number of objects that we have certain in a hurry, as reference we will use instance, admit er, which takes three arguments, the game objects that need to be created, the position where it's need to be created and the rotation that you want to sit when the object is created. So we call in Stan should matter. Passing the game on which we get from the random value from the ordinary, we will create the object of the current location. Onda. We will set the tradition toe identity. Finally, we'll make the took at you. We will call this matter from over stock metered, using a start courting and passing the name of the middle that needs to be called. Let's say the script and go back to unity. I will create a new game order in the hierarchy now on the name it does game manager and at this group there were created Do this game object. So let's track the game manager object to the right side of the screen said the size of the country Do fight and Dragon robbed the off the one after another. No, let's test. After two seconds, we create a new in me randomly and movinto us. They left side at some speed. So this is working, as expected, only creating one Well, I forgot to call the major after we create the first inning a den of the middle Hold the cordon using the start Gordon with save the script. So play one more time we're getting more than one in me. The script is working is expected. Let's adjust the size of the spike. Once prayed to match, our, uh, player dragged the spike prefab into unity and said the except for unit for the spray to 50 . Click honorably. Also just the color them. There is a touch too. This bake one sprayed Do magic with these bread. Click on the circle books towards the right, off the books cooler, then re sick. This will make sure that the letter is a district of the image. To apply. This changes click on the drop down on top off the game object that is below earlier. This will show the changes that we have made for this prefect. We can replicate it, toe all the other objects that be that use this prefab to update the 10 years. So click on a play. All this will say the river with mortification. No, Did it the object. Currently all the enemies get created at the same position. Same by position. We want ground level in this like snail slime and spike to be on growing on other two enemies. Toby in air. We will make changes to a script to make this possible in the next video, so stay tuned.
4. Fixing Obstacles position when instantiated: Welcome back in this trade, Auriol. We will set the position in my axes so that overgrown enemies we'll stay on grown and playing in Miss can be in here. Let's go toe object Movement Script Onda I had a new in, um to defend shit the enemies public in and limiters objective. And in here we will on a flying in me and give a value of zero Fareed ground in me. We will add other other types to this inner later. No, declared the object type variable which we use, Uh, toe I inferred origin. So make it is a public object. So they concert in Inspector Never call it jazz game Object. Now let us go toe of the creative scrip and inside the creator in Miss Matter After we create in me we will get the object movement script attached to it By using the gig competent mentor Let me renamed the toe in me and you can press control and dot Do minimal the difference and I will get the dead woman's group Then we check if the created is off by playing in me then Jana position in way else If it is a ground in me then said the object on ground. Let's go to unity and check what By using Why should we need to set before the Let us said the object type off the in you prefer to their times So let me select the flay in me Prefab on click on open Prefer said the old gyp type toe flying in me Let me rename the type. Also change the name in object wrote a script. No back the unity, said the object I for other objects. The first table spike can be said to be on here, but the second table spike should be said to be on ground No dragged the flaying and me to see Mu to know what by yourself they need to be used for flying objects. I will compare with player hide. So I think the value of fun Bonfire, uh, one point to fight looks good for playing in me uh, the value in wake and we between negative 0.15 toe 1.25 earned for grown in me. No, si, I think it's around 0.65 So it's around my No. 0.6 foot Let's check. It's the value of explore other objects as well. So snail personnel it looks good. Let us drag spike on the circuit. Dorm minus 0.6 way. So the specs air going below the ground. Never. We can create a new object type and use it to identify the spikes when they get created. So let's say they value in script for no. I think the further grown specs W. Is around minus zero point to fight. Let's add it. New objective holidays grown spike. We only need to set the Inam value for first value and the comparable Implement the value for next day. Now go to object creation script. Use a temporary vegetable for saving the position off game objects that God created, and between the value off this vector based on the older than me that God created. So if the object is a flame in me, then we're Lemole said. The value between negative 1.5 and one point do for you, then said Devalue toe the middle God Creator. Similarly, we will set the position in life for other objectives, for grounding me. The position in way is Nega do 0.65 Instead of setting the position every time, we can set the value only ones. So I got the court and bested over here. Also, we have another object that we need to check for drone spikes. So when we got an object off their tent, we set its value in rightto negatives it up 0.25 on. Finally, we will enable the object by moving the court down, said the script and backed immunity. Don't forget to chain the inner value for grown, Spike said. The type of ground spike on beacon. The drop down then apply at all. Let's did it all the enemy objects Andhra. Now again, we have Spike and me on air and grown in me on ground. So this is a good start. It's working as expected, I forgot to enable the trees have grown spike. So when the ground spike, prefab and enable the east rig around, that's with random in regeneration on object movement. In future tutorials, we will work on creating batons for enemies, So instead of randomly generating and miss likely did here we will save some sets off enemies on randomly created them and turned them. We will also work on object pulling for increasing performance off cream by reusing the objects that that we have created earlier. We will also implement by relaxing for our background objects which will have a great enhancement usually for our game all that in the future tutorials.
5. Detecting collision with Player: hello in this tutorial will implement collision for our player controller. Before that, let's it the order of our game on drugs For Henry, this is needed toe on the issue off other game objects, rendering on top off our player or any other game object. For example, if he had a background in Egypt Onda, we didn't set the order in there. We may fail the issue that every other object is behind the back room. Another game of this I will not be visible. To avoid this issue, select or play a character and in the sorting layer, click on the drop down books and add a new sorting lier click on the plus button and named their sorting there as a player on two more layers. So different shit. So one is for four grown Andi, and that is for background objects. Reorganise them. Sister background is first foreground. Layer is the next, and play earlier is the last. The objects in a background layer are in the last. Full earlier objects will be rendered on top off the background layer objects and finally, on top of for lead. The Blair layer will be under no, said the sorting order for her player Object no player layer and give a value off 100 for order in with ordering. The leader also said this sorting layer for in me objects open the reform, said the sorting layer two full grown on Give a value off, then for ordering layer. Do the same for other in MRS will. Open the preferred gender sorting order and order earlier. No, let's start with checking collision. We have already security body on color component on our player object. This two components are needed to detect collision. Also, we have added color toe in me objects on enable the east trigger checkbooks on them. No go to our player Control a script. We have a pretty find method that unity correlates. It's called on trigger and dirt duty. This function gets called when our player of just comes in contact with any other object that has colored hair attached and trigger enable. But no, I will just print the name of the game of that. We have tolerated it for set of island. Let's play and see. No, we can see the message printing on the console. So instead of writing a condition to check for every enemy object we will use attacked a group objects that share common functionally. So there is a new day. Click on the bagged rubbed on click on our new dad. Name it as obstacles. No, said the tag for all the enemy objects to be off Obstacle open. The prefect said that tagged obstacle Do this for all the in me objects. No, inside the entre method, we will compare the tag with the guy that we have just created that is absorbent. So collision door comfort back. Let us print them. I say that were collected with an obstacle. And then we will pause of a game to show that ever game has ended. So we will use timescale setting times Get to zero will pause of again No, let's go to unity, Andi, see if this works. Looks like we got an error. Just the name that we have given in our gold. Okay, I think we missed Day s Savo Scrip End play again? No, When collated with any of the game stops on, we get a message. We have basic functionally off game. So we are anime generating in Miss Also in creation with her player out there in next to the railway will create some set off enemies. So instead randomly generating them. We will change the objects and use them. That's in an extradited. Thanks for watching.
6. Obstacle level design: welcome back in this riddle, we will design our obstacles, said, which we will use do randomly generated our objects in stuff, creating one obstacle at the time. So before that, I notice it's more glitch with a player character. When we transition from walk, toe, duck and mission, it looks like we're making a small jump. This is because off our core later we have set for our player. If you remember, we have to Coretta's for a player that gets enabled on change when the king or walking, let me change the spread to duck. The color for black animation is sick, higher in my position in the normal Glater. So as we have a rigid body with gravity and even when we disabled the normal collector, the duck Coretta forced to groom so overcome this issue when you don't just a fiver forever deck sprayed. If you observe our player, the angles has said Toby Middle. But that exploit remains in here to fix this senate. The back spread in your project said the pie work in way does 0.65 This will move up. I heard for this pride a bit up in my direction. Don't click on a plate. No, our plan looks to be on ground. Also just the decorator to master Spread said the duck quarter inside the player and move it down in. Why access and in the cooler is below the food off over player. No, if we run the game, I will walk on then duck. No, that looks better than a Lear. Let Mary said the players sprayed. No, Let's start with Optical, said designing. Currently, we're creating one obstacle or one in meter time from right of the screen and moving them towards our player. This doesn't throw much challenge for our player as we are only real angle randomness and not designing any hurdles. So let's work on there. Dragged the obstacles prefab into the hierarchy. Created empty game on, Rename it as Obstacle One. This will be parent, uh, to our after concert. Let us let us know what the minimum in my exam position invite. A lot of students can be up to so compared toa player. If laying after girl can be up to one born fight, Onda grown obstacle will be at around mine. Is it upon do fight? So this will be the minimum and the maximum position for all over obstacles. No. Make the two obstacles as child off empty game object. No spit plays the spike in the set. Randomly give some challenge tour player. I will read it them in place in a random order. I want play to duck and jump more often so that he will not be ideal for long. Pain. Are just keeps on jumping or ducking. Make sure that there is enough space between Obstacle. You're not blocking the player from making tempore cooking, so let me duplicate the spike and they used them for no, uh less with few objects. So let me just make another duplicate off Spike and just drag it at the end. Also, just the tradition. Maybe just don't move. It entered in within the way. So noticed Just with this sec. First, disable the Object Moment script that is attached to the child objects. We will advise the script, toe bed and Dodgers. No more on the tail elements. So let the player object and at the audit moments group give a value for spirit. Let's thank dependent up. Get outside of this cream and also but no. Let us disabled our victory. Descript, I wonder, as the obstacle said, for no, Let's click on play. This looks good comfort to the random obstacle generation you can add. Other struggles are in Mr This Set. Let's add a few more obstacles. Also remember to disable the Object Moment script on the objects, as we have already. I read the script or a doctor, so let's add a few more off objects and dissemble the object moment script on them and place them properly. So I'm having uniform distance between two obstacles and said the sick. Use your career duty and make some obstacles. So this will be your task for this video isn't as many sets as you can. Full of the steps that waited in this, we do so make it on price it. You can also make it difficult way. Reducing the distance between through obstacles are two inmates inside the sick. This is a task for you guys, so make some sets and come back in the next video
7. Random generation of Obstacle sets: Welcome back. Hope you're made few obstacle sets I have made around the fais. It's for testing. I used the combination off both grown and in Aaron, Miss. How kept the transparent due in May. Objects. Same for all the sets. You can make few cents tohave less distance. Give more challenge for player. And also, if you're sets with more distance, don't make it easy for the player. No, we will use this set in our declaration script to randomly create object in stuff creating them. Wonder. Today Let's save the obstacle as prefects inside the prefer Fuller prayed Anoop Fuller and name it as obstacle set. Drag all the obstacles one after another into this folder to create a preferable that obstacle. No, I can disable the optional, but I will have them, inspector so that we can make few changes in the future. Select the game manuscript and inside our object creator. Replace the objects to create a really with this obstacles dragon grope the obstacle to say the reference, Let's play and see if that works so it's working, but we need to increase the duration off off the creation. Open the all decoration script if you Look, I have a good we call over creating limiter inside the start and it will randomly create the objects for every two seconds. Then we take the object and I just explosion in y axis since they are creating optical sets . And although drugs in it are already placed correctly in a correct way position, we can remove this part off court. After creating the object, we're going to call the same Corti and wait for two seconds. Funnel, Let me increase the time to around five seconds. You will see that even when we increased the duration, the new objects that we create will still overlap with the existing office. So let's save it and just go back to unity. A second plane? No, if you create another. But after five seconds we have our first obstacle, said creator. And after five seconds, we have the 2nd 1 As I said earlier, the second obstacle certain we left the 1st 1 This is because if you look at the scene, we know we're creating all obstacle at the same position. I will play our game dissembling clear. I will play one more time if you notice the struggles air creating at the same position on his there are wrapping with each other. But we want our obstacle to get created at the end off already created obstacle. To make that possible, we need to make some mortification toe obstacle set prefects enable upriver create a new and big game object drag such that it is at the end of all the objects in the city. I will rename this object as enough certain we will use this object Don't know. We know certain ends on said the new object that God created at disposition. No, a planet tennis for the preferred bidder. Do the step for all obstacles that you may. I will duplicate the empty game injured and drag it into another sip. Adjust the position and then I play prefab genders. We need to have a reference for this object from our script. Good. Without that moment script and a new available off type, I will end this object as end offset back to unity Dragon robe The enough said object in the same The reference from script. Don't forget to a play the changes for your perfects repeat this step for all the obstacles and make sure the desert in the right off ordered as reference. So I will said the reference for all my script and come back. No goto off the create a script. I will add a new variable off victor to date of recorded as instant share position in sensation position. We will save the end off obstacle position for the object that we got created in this variable on you. This value flutter said in the position off next object that gets creative. So you never met there where we create our objects. We will set the instant station position to the end offset position. Well, get the value off in except by calling the get component. And we'll get the position of an upset. And but he was in the transform guard position. When we create ever objects, we create them. A position sailed in this variable. Currently we're creating, I know game manager position. I will change there too in sanitation position. Also, we need to set the instance ation position to transform that position has the start. So So in the start matter, we will go there. No, we can register delay between object creation. Those two seconds as we were orbiting the institution position and the obstacles will know will not overlap. So say the script and get back to unity. Fully one. More than no obstacles are getting created on, then are getting overlapped. I would listen with the player and play one more time. So if you're observing the scene, you Paula off signals are getting creator and Seto end off a little credit. Sick as we wonder so there. This is looking good. I want to add a small future tour player. I want a player to get back on groom from here when we press on the Donadio. Currently, we have to wait for our player to complete the chimp and then land. I want a player to land immediately from here when we press on down there. So we really add this future in the next video
8. Adding new features to our player : as discussed in the last video. I want my player to land on groom from a when we pressed no narrow. So let's work on. Go to the player Control a script. This is the part where we Jim So when we press a barrow on when we please, don't we took But we will not be able to duck when we are in here. What is that? A new middle and more This part of good into Demeter on a new method called Jim Going to go from here. And best it over here call limiter A new middle for duck Going to go from here and best it over here. Call a meter when repressed donor 11 moment ID call it does from And then this mother gets called when we release ever donadio to make a gym. We are exam fools Invite addiction. We will add some force in the opposite direction to make it land When our player is an air . It was that is at a new middle name. It does ducking in. Let's add the same court to add force in don't narration to add force in the direction we need to multi plate within negative value. I really want to play with so to double the force toe land our player faster, very modern in air Bull and also remove the animated Not said Good. We will call this matter when we are in air. Andi when we pressed donator so we will check for the donor using input or get Kidan and use kiko dot Donahoe. Call the duck in air meter so it's not good, but not its get kid on no sales group and back to unity. No, we're running and when we are in here, I press down arrow. So we're learning faster, so we're learning faster than before. We can reduce the duration in air by increasing them on the plane factor. So it's tough. My playing by two. We can deploy by three and see how this looks. So this is much faster than the electron on but also looks better. So Blair has brought a new future. Our game is getting better and they're looking awesome. Currently, we are able to more obstacles, that same spirit. In the future video, we will add a new script which will manage the speed off our game and slowly inclusive as our game Perrotta's. So that's all for this video. Thanks for watching
9. Creating Object poll for our Obstacles set: hello. When we come back in this video, we will integrate off the pool to reuse the created obstacle said In the current through, we're creating obstacles and they keep on moving even when they have passed over our player . So let's goto our of the creative scrip in this group. I will add a new variable off list type with sticks game object, then he never start matter. I will insulate our list as master can pull equal to new this stuff ups to compose. Then you never created me middle. We need to check if our obstacle pull gone is greater than do that means we're checking if we have already creating obstacles. If we did, then we get the obstacle from this list which are not active in our game. I will add a new matter for this purpose which name it does get up stricken, which will rid any game often. And we will call this metal from ore, create enemies, creating new empty local game object which will save the object that we when we call the get of sticking with it and said the position of the object that we got to instead shit position. Then we will make the detective also update the instance She ation position to the end of the object position. Copy this court from here and Mr Door here. If there are no obstacles that were created a Lear then we will create a new one from this part of the workers. But it will be same Good that we had a little after recruiter An obstacle We need toe addict toe our list. So after cold polar air campaign me Let's finish that. Get obstacle matter. We will go through all the objects in the list on Czech Foreign You next game object I will use the not condition Don't know whether the game object is that they were note Then we read ended object. If we don't have any enact o object, then we need to create a new tip on returning. This will be similar toe the game of the creation. So let's go b the court we have here Onda wasted in the get up stick lamented for no Let the random value B zero Well, Pastor, in next value When we call the middle and ridden the object that we created Let me make it clear one more time. We will take it over a struggle Pool has any objects in it. If you have any objects, then we will call the get obstacle method in the middle. We go through all the objects in the list to find any net or took and redundant object. If there are no inactive objects, then we cleared a new object using the index that we get from the calling function. Let me make the list variable public so that we can see though Mr Be created in the unity. No, the books are good in creator Andi, I find one book we're creating obstacles set, but they're not adding nor getting added to the list. If you observe in the Inspector, we only have one object that got added to the list. So let's fix this. Go to the script Onda, where we create a new obstacle inside. Get obstacle method. Let's add the created object. Do the list. Say this group Onda Play one more time. No, we're creating the obstacles and they're getting added to the list. Good to this group. Currently, we're only creating the objects had in egg zero in the area but we should be able to create other objects as well. Trust in the Creator and Miss Smith cut and paste the random court ever the if statement and passed the random value. When we call the get obstacle metal, then go to the object movement script. I will add a new available off type in digital and name. It does NT We'll use this variable to check with the value of a bus. Get obstacle. So in inside the fridge loop we will get the object i d off the current object using get component mentor Then we make it tick That is, if the current it is simply is equal to the one we waas Let Mary name random where you do i d. If both conditions pass, there is if the vote is in there too on the idea is him. Then we read em the object as we cleared a new object from the other under doing it. So save this group Now Let's go to unity, Onda said the 80 foot tower of struggles Make sure that the I d will the same as the order in which you have dragged the objects into the area obstacle one will have an idea of zero of tickle to will have an idea off one on. So this will make it easy while we're creating over objects using the random value from the area instead of comparing with Aidi. If we said the same idea with the order that we saved in the American directly create the objects using that a index itself, I just wanted to give it a quick update. It only started there 80 from one instead of zero. So in your case study already from zero. Finally say the tenants to the prefer parent, I will add a message. Don't know the I d. Off, though, just would be created. So let's say Andi go to unity. So they're creating different obstacles with different I d numbers so you can see them in the concert. No, we need to have a way to disable the objects. Once we're done with them, the obstacle becomes useless, wants the past the left side of the screen. Once they go out of the screen, we can disable them, but we need to know that they are. Trickle has crossed the left side of the screen to do that. We will add an empty game object and place it on the left side of the screen a bit far from the camera left side. We will add it. Box called other component enable the east trigger checkbooks Never aged body. So this game object. We will use this game object to check for objects that collided with it. Eso will make this on dip. Every doll took our Lord that will pass through it. We want the objects to remain at the same position and doesn't get influence by gravity or collision. So we said the grab this scale off the rigid Warrick to zero. No, let's create a new scrip. Call it as object dissembler. Open it. We need on trigger into Tory meter. We will compare the tag off. Those will be collected to it when the game objects gets triggered and we compare if the object is has a dag off obstacle on it, then we disabled them. Obstacle object. So if we observe obstacle sec, we need to disable the object when we reach at the end of them. Dixit. To do that, let's add a box cooler component on the end. Offset game of it enable the East trigger and also said the bag for this game. Object do obstacle. One important thing that we need to do is toe. Add the object in a different layer so that we begin a word collision with our player. Object. Let's add a new layer in our layers stable, then said the layer forever end offset object. Click on a plate In this your parent prefect. Repeat the steps for the remaining off struggle sets as well. So Erica later enable the trigger took both. I heard it, Doug. And also add a layer, then a play tennis. Do this for the rest of the reef. Obsessed? No, we need to make Jane is with the physics collision. Metrics. Click on edit private sittings and then select physics Study. Scrolled. Um, we have a collision metrics. Unity uses this metrics. Do know which object on a particle earlier can calculate collision with any other layer Logics? No, we have said the enough obstacles object in the end of object. Earlier, let us ahead. Our player do a new earlier. So let me create a new layer and name it as player and I will add our player character to it. No, we want over player toe in tracked undated collision with all obstacles that are in in the prefab except for the enough object. So in the mad tricks, disabled checkbooks, where are player and enough object layers meat. We also don't want our player to reader collision on the same layer, so disable the player layer as well. Enough object can interact with any other layers. We will leave it like this. No select the on December game, object and drag and drop the obvious dissembler script we have created a year. So inside this group, we compare that that I need to add It is and and when it matches, we will disable the parent game object. We can get the reference to parent and disabled it. No se the fine. Go to unity. Let me disable player and run. No, again, let's rectally collects with our disabled object. Okay, the objects inside the obstacles are getting disabled. Okay? This may be because the object also shared the same deck. Let us create a new tag for our enough object. Onda said it do all right. Enough object said no tip. Do the same for the their preferable picks as well, selecting all the objects and a play for all. Then instead, I was crude. We compared the tag with end off Sit, Say the script then in your d play one more time. Select the enough object. This is not disabling. Barren project, but disabled the enough object. Not sure. Wait, this didn't work. Okay, let's send your court to get directly directly access the parent and then the game Object? No, there's one more game. Let's wait forever. Object to collate. All right? No, it has the were able to disable the parent object. Let me trade one more day to see if the disabled objects got enable andare using first increase the spirit of the movement. Observing the inspector? No. When the guard disabled and then there getting enabled. That means we're using them. Our object pulling is working as expected. Okay, Uh, so no were successfully integrated or the pulling into a game. But one issue I see is there when your player collects with obstacle don't we have some gap between the objects? But the collision is still triggering. We will try to fix this in the future Tutorials. That's what the get pulling. And we have come to the end of this video. Thank you.
10. Object polling Update_Fix: Hey, guys, I met this video. Give a quick update on the fix. So some of the students have been reporting that they were unable to get the obstacle relation stuff correctly. So whenever they you re used the obstacle, they were almost like overlapping with already existing obstacles. So I wanted to update on this. If you look at the audit, preferred that I have the obstacle prefer. So I have the paid in brief, which is a which is in front of all the obstacle prefers in the list. What is that? All the obstacles And this is my parent Prefect. So it's currently place at the start off Holy Child prefects and also the way position off this parent prefer be set to zero. And also another thing is to make sure the end off sick, the one which we used to get the next instance. Asian position should be placed after all the articles in the briefing. So check check in the scene. You. So my enough list is at the end off only trickles. And also it's why position is set to zero. So you have to make sure that the way position for both end of certain and also the pair and prefer it's set to zero on another one is due the game manager. So you also have to set the game manager by position, toe zero. Because when we create the obstacle for the first time, we will use them game manager position and instead shit at dysplasia. So you need to set the operation off way position in way for the game, manager to zero. So this have the three step that you need to follow to get the off degradation stuff working correctly. So I hope this will fix you were issues on, you will be able to replicate the stuff that we're did that we did in the course and also will be able to finish the give thanks.
11. Fixing collider for Player and Obstacles: in the end of the previous video, we have no disturbed. Even though our player is not in contact with the obstacle option, it was triggering a collision. This is because off the gap between cooler and sprayed like you see here, we can use polygon collectors do welcome this type of issue, but for young collectors are more costlier Comfort to a book school the other way, they began overcome is to use multiple collectors at the same time to cover most part of the object. So let us try, Do implement that. Don't our player. Since ever player is animating and changing Sprite, we can't use polygon collaborated. We will use more than one killer. Sell it the normal Claytor and a just equal later hide and wit so that it covers the bottom part of our sprayed that is a calculator. So the company with the same game object we can add more than one call letter to the same game object. If they're off different days, I just this article corredor com Print position in extend way. But a distinct off sick includes the radios took over the top part off the player. This looks good So let's do a similar thing when our player decks first let me genders break. And then Jane, the Baltic a letter were then hide then Allah Circle Kuroda, duty component. Also adjust the off sick on radios to make it to make it cover the top part off the body. This looks good. No, I will change the sprite back to the normal one. Let's play and see. I tried to call. Activate an obstacle. We're groaning. Let's make fitness, Corretta. Forever off tickle spreads as well. I related two game objects on day. Leave the rest as assignment, so select the slime game object that is inside the Prefect Fuller click on open Prefer were working on the barren prefab. So any changes that we made toe this came onto will replicate to the objects that we saved In the obstacle set for slime. We will add a polling on collector. This I believe both Kolender on enable East trigger checkbooks for the Polygon Gallery. You can adjust the color that by clicking on a collector and remove any and wondered it just are polygon so that we will use less number off millions. Let's make tennis for spike. Prefer best bill Open Spike prefect, then add a new polling on Call it a confident and enable is trigger check both. Also, don't forget to remove the box corner so the polygon collector has greater, more number off polygons then that are necessary. So this is a drawback with polygon colors. It takes more processing time compared toa other collectors. No, see the tennis. The genius that assailed will automatically get updated with those taken. Sit as well. Repeat the steps for any remaining of students are objects if you feel necessary, so let's meet in the next video. Thanks for.