I Tried MidJourney to create 2D Assets for Game in Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] hello everyone in this video we will be exploring the exciting world of the AI art and how it can be used to create stunning 2D game assets we will be using the two popular AI tools mid-journey and stable diffusion to generate our assets we will use Photoshop for a bit help and then we will show you how to easily import and use them in unity which is one of the most popular game engines out there of course you can use any other engines whether you are a game developer artist or curious about the AI art this video is for you so sit back grab a toffee and let's get started [Music] AI art with so much Buzz surrounding this new technology I couldn't resist the urge to put it into the test and see if it could be useful for creating 2D game assets that's why I was inspired by the art style of Rayman Legends and decided to see if I could recreate a scene in unity using AI art so after playing around with AI art and using it to create game assets I can say it is definitely a valuable tool for game developers and artists alike it can help save time and effort and it opens up new possibilities for creativity and design we will cover three types of assets the normal 2D Sprites such as the trees grass clouds Etc the second type is the character that we will animate in unity and the third type is the ground or the terrain which the player will walk on I'll use Sprite shape for that in unity so let's start by creating the normal assets such as the trees I started by writing some prompts like jungle asset concept art and inspired by Rayman Legends art style but that seems was not good enough so you need to be more specific to create your assets and of course you need to set the background to be plain to be able to cut them in Photoshop or any other photo editing software so to get the best results I found that you need to be very specific so for example if you want to create a highly detailed tree you need to specify that in the prompt so for example I wrote 2D big three concept art Rayman Legend style plain background and it gave me this result then we simply import that into Photoshop and using the new feature the object selecting tool we can just drag a square around or rectangle around the tree it will automatically select it but it's not perfect of course you will need to use the other tool which is quick selection to add some ports or remove them so for example we need to add those parts of the three so we just click if you want to remove some parts you simply click the alt button on keyboard for Windows and deselect the parts that you don't want them to be selected of course we can remove those leaves those leaves on the left also this is not necessarily true then we click select and mask of course it will not be perfect there there are those areas at the edges of the leaves which still have some parts of the background to remove them first we try to click refine here ah it helped a lot if it didn't like those areas we use this refine Edge brush tool to refine so as you can see we're removing the background from those areas so I advise to simply draw at the edges of all the art or even the places where you believe it should not be included to remove them so after doing this process it will take time so I'll speed up just to show you what I mean then we click OK ah before that I advise to set that smoothness that moves to one and also the shift Edge may be to minus 20 percent so to make sure that we're not selecting any part of the background hit OK and now we can cut the tree and place it on a new layer and delete the original photo as you can see now we perfectly selected the three and it can it is transparent the background is transparent so we can place it anywhere inside our game then we save it as PNG and import it to Unity so simply after importing the 2D image into your Unity project I started the project using the 2D template or the urp to the template then drag the tree into the scene and voila you have a perfect 2d3 for your 2D platformer game or any other type of games I use the same technique to generate more assets such as the bushes and some mountains in addition to some clouds and finally generated the sky using the prompt minimalistic Blue Sky gradient next we will create the platforms which the 2D player will work on it and the easiest way to achieve that by using the Sprite shapes so you can create that by going to 2D object Sprite shape and closed shape I started by the samples which are included in the 2D Sprite shape so if you don't have those that I have here those examples you can go to the package manager search for the 2D Sprite shape in the unity registry and then go to the samples Tab and download these samples so to replicate that or create new art using the available art you can use mid-journey to start from a source image so I started using this grass top to create a new grass top for my 2D asset and there is also a fill Sprite so go back to Mid journey and upload any art you want to use it as a source to generating more assets like it then you can right click copy the link then write a prompt imagine paste the link of the source image then write any prompt you want so as you can see here I pasted the link then wrote The Prompt 2D jungle grass asset Rayman Legend style and kept generating assets till I got one that seems good which is this one then I upscale it then I did the same steps we did for the three by cropping the grass and polishing it to be used in a video game the next challenge was to create a seamless texture in mid-journey version 4. it seems it was not supported also if you create it using mid Journey version 3 it's not the same art style that we created the other assets you can check if any texture is seamless by using the seamless texture Checker tool online and as you can see terrain or the texture that I generated is not seamless so if we go now to stable diffusion and go to the image to image tab select the image that we generated from mid Journey and type the same prompt we wrote there minimalistic seamless dark brown soil with rocks Raymond legend style and we go down and tick the tiling check mark and set the this noising strands to something like 0.35 like 35 percent then hit generate and you will be surprised with a good results that can be seamless and we can make sure that is seamless by saving the image save download okay and here you go you have now a seamless texture that you can't know where it's cutted so next you can create 2D Sprite shape so right click create 2D Sprite shape profile and simply you can choose the fill using the new texture we created one and also you can choose the topping to be the grass that we created and here you go we have the profile ready then we create 2D Sprite shape closed one and we choose the new ground profile that we created here you go and now you can build your level easily in any 2D game using the r generated by mid-journey and stable diffusion see how easy you can control this Sprite shape okay so now we have everything ready to create the environment of the level let's put everything up then we go to creating the character foreign [Music] the 2D vegetation Shader graph where there is a full tutorial about how to do the same down in the description then I created 2D character using the prompt 2D game hero character design t-shaped Rayman style then I did all the steps the same as we did for all the previous assets the only difference here I did more steps which is related to correcting some body parts so for example here I corrected the hair Direction and also the second part we need to make sure that we can animate each body limp perfectly in unity so for example you can as you can see we can animate the left hand the left leg and right leg while the right hand it's difficult to be animated freely so what I will do now is to copy the left hand and flip it to make a separate part as a right hand then we save the file as PSB file not PSD then we import it to Unity to rigid and animate it if you want to learn about rigging and animation we have created previously another full tutorial about how to rig and animate your 2D character then I created two animation one idle and the other one is the running animation of course it's not that good just for testing purposes then we added a player controller to move the player around the map if you want to learn more about the player controller I have listed another full tutorial which we created previously on our Channel down in the description and I added a virtual camera to follow the player using the cine machine and set to follow the player as a Target and that's it for today's video we created a full 2D platformer using only the assets generated by mid-journey and stable diffusion let me know down in the description if you think it's good enough to be released as a commercial game and of course all those project files are available to all our supporters on patreons who keeps generously supporting us to create more content like this if you like this video don't forget to hit like subscribe and the notification Bell so you don't miss the next one the next video see you soon [Music]
Info
Channel: Binary Lunar
Views: 169,010
Rating: undefined out of 5
Keywords: ai art, ai animation, 2d assets for games, 2d assets unity, 2d assets free, 2d assets using ai art, how to create 2d assets for unity, how to create 2d assets, create 2d game assets, use midjourney to create character, use midjourney to create 2d assets, use midjourney to create games, ai art for games, ai art 2d assets, midjourney 4 tutorial, midjourney 4 seamless texture, binary lunar, stable diffusion, stable diffusion tutorial, unity 2d game tutorial
Id: -Z18PWEOj1I
Channel Id: undefined
Length: 12min 48sec (768 seconds)
Published: Mon Feb 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.