top of page
Search

2D Animation Notes and Unity vs. Unreal Engine

  • esb690
  • May 2, 2022
  • 4 min read

Updated: May 4, 2022

I have been working through professor Wagner's tutorials on 2D animation, and I'm still considering whether I want my project to be a 2D or 3D game. This clip is what I have working so far:



And here are my notes:


Be sure to set up a naming convention for the game when starting. For example “20220428_2D_gamename”.


Since this is a prefab project, scripts are premade. I will likely be looking for a prefab for my project because of time constraints.


Player object will keep all the logic; moving shooting etc


Rigidbody 2D gives the object physical attributes.

Circle Collider 2D gives the object collision.


Display object will hold sprites/animation.

Sprite Renderer will hold player sprite.


Turning a sprite sheet into an animation:

Add animation clips to create animation. Create > animation

Animation controller to control when animations are played. Create > animation controller


Drag and drop the animation controller into the animator. Open the animation and set frame rate (on this project, 12 frames).


Drag the sprites from the sprite sheet onto the timeline to create the animation.


The Idle animation can just be the 1st frame of the walk animation, in a simple 2D game.


The Die animation can be recorded so it does not loop, and end with an empty frame so that the player disappears.


The Walk animation will cycle through frames when the player is moving, in this case 8 frames.


Set Idle to be the default state of the player character within the Animator.

ree

Then we create Parameters to create the logic to switch between animation states. Create a Float and name it Speed. Create 2 triggers: Cast and Die.


Right click on an animation state and Create Transition from Idle to Move. This transition will be based on the Speed Parameter; if speed is greater than 0.1 we transition from Idle to Walk. Create another transition back to Idle and set the inverse parameter to go from walking to idle.


The Speed parameter used in the animator still needs to be defined in code on the Player object. I would have to figure this out in Bolt if I were doing my own programming:


ree

The display object would be assigned to the animator component in the “Player Mover” script in the player object.


The Cast animation can be entered from both the Idle and Move states, using the Cast Trigger.


The cast animation will be used with the Player Shooter script and create the bullet object.


The Shooter Listener script will be applied to the Display object so we can access the Player Shooter parameters on the display level. This is necessary so we can access this function within the animator, which lives in the Display Object. The Player Object then needs to be dragged onto the Shooter Listener component.


In the Animation Timeline add an Animation Event by right clicking on the timeline at the point where the bullet should shoot from the player character's extended hand. Select the FireRead () function (which is only available here because of the Shooter Listener script).


Collision Layers need to be set so the bullet doesn’t immediately collide with the player object and destroy itself. Create these layers in the inspector on each object in the top right of the window, and set each object to its respective layer.


In Project Settings > Physics 2D you can enable/disable which layers collide. We only want the Bullet to Collide with the Enemy layer.

I had planned to test out both Unity and Unreal Engine as potential platforms for my project. However, because of the cognitive issues I'm still dealing with from covid, I'm finding myself short on time and would only really switch to Unreal Engine if it would give me a major edge. I'm getting familiar with Bolt and I'm going to continue practicing Unity in Wagner's class, so it may make sense to stick with Unity. I understand that these two platforms are similar enough that I could accomplish my goals with either one, so I watched this video to get a sense of the differences:



I took a few notes:


Unreal Engine has more built in features and functionality from the start. Unity is meant to be a lightweight and modular engine. This can be challenging and limiting for beginners.


UE has Blueprints, the equivalent to Unity’s Bolt visual programming plugin. There seems to be consensus that Blueprints are preferred over bolt by game artists because they are more versatile. This may not matter since I will be using simple visuals.


UE generally is considered to have better graphical capabilities. They both perform well with stylized visuals, which I will be using for my project.


Unity has a larger asset marketplace. This is a major point in Unity’s favor for me.



I'm going to stick with Unity so I can build on what I've learned while planning my game this week. I'll take some more Bolt courses as I start building. I also want to review a couple more games to get a sense of which game mechanics would be good to include. Tomorrow I will post a more detailed overview of my project and what my goals are. Thanks for reading!

1 Comment


Angel Martin Palomares
Angel Martin Palomares
May 04, 2022

Unreal is always my go to when it comes to animation. The way things are rendered and handled just makes it a more fitting place if you plan to show your skills in animation.

Like
Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Eli's Media Project. Proudly created with Wix.com

bottom of page