Sitemap

Unity Dev: Logical Animations

5 min readMar 30, 2021

--

Press enter or click to view image in full size
Ka-BOOM!

Note: You’ll want to be sure that you’re adding the animation to the object that your Enemy’s Sprite Renderer component are on. I have my Enemy object as a parent to another object called “Enemy_Sprite” which is where the Sprite Renderer lives.

Press enter or click to view image in full size
Frame by Frame Explosion
Press enter or click to view image in full size
Press enter or click to view image in full size
Enemy.cs
Null check, null check, null check

Note: I use GetComponentInChildren to fetch my Animator component because my Sprite Renderer, and now Animator, components are on a child object to my Enemy object.

Enemy.cs::OnTriggerEnter2d

--

--

Alex Somerville
Alex Somerville

Written by Alex Somerville

On a quest to become a game developer. Still sometimes providing unsolicited advice about how to function in society.