2D Sprite Outlines! // Unity Game Devlog #5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] currently the only indication of which object you have selected is this rotation handle and that doesn't show up for Springs or connectors or circular objects so I want to add an outline that will show up whenever you're editing something so I tried a few different methods of generating an outline from using a shader to just scaling up and tinting a copy of the image but the best looking solution is to use a line renderer that traces along the outside of the sprite [Music] here's the line render out line implemented in the game it's actually kind of slow to generate these outlines at runtime because it looks at the mesh data so I just made a script that will attach to a prefab that can just generate an outline that will just stay part of that prefab so that it doesn't have to be regenerated when you zoom in or out the outline size also changes and if you zoom out really far then you can't even tell that there's an outline there so I think it would look better if the thickness of outline always stayed the same relative to the screen so now the outline scales to maintain its thickness but because it's relative to these objects it kind of looks like it's growing and shrinking instead of scaling directly proportional to the camera size the outline now scales relative to the square root of the camera size so if you zoom in the outline thickness increases but it doesn't increase as fast as if there was no scaling and if you zoom out you can still see the outline next up I want connections to form between build objects and the terrain pieces and also I need to fix this outline not showing up in front of the terrain okay now objects can connect to the ground I needed a totally different solution for determining that the location of where connections should form two beams are just two rectangles so the point they connect at can be calculated just with some geometry but some terrain pieces aren't just simple shapes so finding a reasonable point of intersection isn't so easy so to solve this problem I just took a sample of different points within the build object and tested to see if they also intersected with any ground piece then I take the average of all the points that do intersect to get the final location of where the connection should form [Music]
Info
Channel: Sam Hogan
Views: 64,077
Rating: undefined out of 5
Keywords: unity 2d, 2D game development, devlog, devblog, unity outlines, game dev, sprite outlines, siege engineer, unity, indie dev, game development, unity 2D physics, unity game, unity indie game progress
Id: 8AKhr3c4HOs
Channel Id: undefined
Length: 4min 21sec (261 seconds)
Published: Tue Jul 02 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.