2D issues and how to solve them with Veli Pekka Kokkonen

Unity · 44K views · 2014 · 45:49

Open on YouTube

Game programming & enginesIndie game developmenttalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering Unity 2D questions about swapping sprites or spritesheets at runtime and about animator quirks, often pointing to specific timestamps.

Recommended by 2 people across 2 different months, 2016 to 2019.

Why Game Development Stack Exchange recommends it

Game Development Stack Exchange users link it when answering practical Unity 2D questions, such as swapping sprites at runtime, reusing prefabs, and building with different texture resolutions for smaller devices.

Recommended by 2 people across 2 different months, 2015 to 2021.

What it is

A 2014 Nordic Game Conference talk in which Unity engineer Veli Pekka Kokkonen walks through common problems in 2D game development with Unity and how to solve them. It covers practical techniques and comes with downloadable example projects.

What people said

Recommends DMGregory · 2015-05 · Game Development Stack Exchange · on “Using Smaller Textures in Unity on Older/Smaller devices”

Adding onto this, there's an interesting technique for generating builds with different asset resolutions described in this video: [this video]

Recommends SanSolo · 2015-10 · Game Development Stack Exchange · on “How to properly use prefabs with 2D game?”

How similar do you mean by "quite similar". Do they have exact same features and scripts? There is a video by Unity where the presenter has a script that changes only the sprite at runtime. Are you looking for something similar? Link to video: [this video]

Recommends Tom · 2016-05 · Stack Overflow · on “Change AnimationClip's sprites in Unity”

You can programmatically change the sprites in LateUpdate() . I've never done this myself, but there seems to be an explanation in this video here [this video] at about 20 mins in. He switches out the spritesheets based on a string which corresponds to a set of sprites. Look for the section called "ReSkinAnimation" (23:00) if you are skipping through.

Recommends Yamuk · 2019-02 · Stack Overflow · on “Is there any way to swap entire tile palette, not only some tiles?”

Considering all corresponding concept's tile sprites are laid out in the same location on each spritesheet, you can change its spritesheet fastly during runtime. Here's a video at the relevant time. [this video] You don't have to recreate tiles, their colliders etc. in this case, but only the rendered sprites.

Cites Luke359 · 2019-01 · Stack Overflow · on “unity3d: Animator bug or feature?”

I've had this issue recently and neither did I solve it there's a unity official video about it here [this video] . But in my scenario it didn't help. So I decided to create different animations and control them with animator parameters. Good luck.

Cites Christopher Cota · 2021-03 · Game Development Stack Exchange · on “Changing Animation Sprites At Runtime Once”

I am designing a 2d platformer with pixel 32x32 sprites, right now I’m using the method that’s utilized at 20 minutes in this video [this video] . I’m pretty much creating a main player parent object and adding the players equipment (helmet, breastplate, leggings) sprites underneath. But obviously when the player animates and starts running the pixel equipment needs to move and shift with the player. The solution provided by the video seems to work fine, but why can’t this just be called once at the start and be set until changed? Basically why can’t I set the sprites at the different frames of the animation when the game starts and leave it. I basically redrew all of equipment to fit the charact