2D Graphics and Animations in Unity 3D

Slides:



Advertisements
Similar presentations
Step-by-Step: Adjust a Chart Axis USE the Pricing Final presentation that is still open from the previous exercise. 1.Click the chart on slide 2 to select.
Advertisements

Macromedia Director 8 Foundation Level Course. What is Director? Director is a challenging program for creating animation and multimedia productions for.
Chapter 6 Photoshop and ImageReady: Part II The Web Warrior Guide to Web Design Technologies.
SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
Power Point Presentation - Advanced Julia J. Stahl Distributed System Specialist.
© Siemens Product Lifecycle Management Software Inc. All rights reserved Siemens PLM Software Solid Edge ST4 Training Rendering assemblies.
Layouts: Creating maps and figures using ArcMap 1 GIS for Planetary Mappers June 2012, Planetary Mappers Meeting.
SE 320 – Introduction to Game Development Lecture 11: Animations and GoKit Lecturer: Gazihan Alankuş Please look at the last slides for assignments (marked.
Creating a MagicInfo Pro Screen Template
BUILDING RICH MEDIA ELEMENTS. Design Decisions Based on Design Specification  Following the design specification will ensure that the application is.
Tutorial 1 Getting Started with Adobe Dreamweaver CS3
Photo Story 3 To begin, go to Start > All Programs > Photo Story 3 for Windows Choose Begin a New Story > next Choose Edit a Project > next after that.
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
® Copyright 2010 Adobe Systems Incorporated. All rights reserved. ® ® 1 INTRODUCTION TO ADOBE FLASH PROFESSIONAL CS5.
Rendering. Rendering is the process of computing frames of video and sections of audio so that they can be played smoothly in Final Cut Pro. Once rendered,
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
© 2011 Delmar, Cengage Learning Chapter 1 Getting to Know Illustrator.
Learning Unity. Getting Unity
Introduction to Microsoft publisher
Derived from Kirill Muzykov’s Rocket Mouse Tutorial WakeUpAndCode.com.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Motion Graphics & Animation.
Simple Sprite Sheets with Inkscape & Gimp David Cline.
What why and how? Telerik School Academy Unity 2D Game Development.
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Game Development with Unity3D
EEC-693/793 Applied Computer Vision with Depth Cameras
Reading and Writing Image Files
Game Development with Unity3D Inside/Outside Unity3D
Computer Literacy BASICS
Chapter 2: The Visual Studio .NET Development Environment
Done already for your convenience!
Imaging and Design for Online Environment
Graphical Output Basic Images.
Layers in Adobe After Effect
OVERVIEW Objectives Follow a design document to prepare images for inclusion in a Web page Run a batch process to prepare multiple images in one step Use.
Google APIs and Facebook API
Basic Math in 2D Game Development
Working in the Forms Developer Environment
Lesson 6: Enhancing Presentations
Image Geo-Referencing in ArcGIS
Tutorial 3 Creating Animations.
Composition.
More (C#) Scripting Day 2, Lesson 1.
EEC-693/793 Applied Computer Vision with Depth Cameras
Learn Animations in Fireworks
Flash Interface, Commands and Functions
Introduction With TimeCard users can tag SharePoint events with information that converts them into time sheets. This way they can report.
MS 2013 POWERPOINT.
EEC-693/793 Applied Computer Vision with Depth Cameras
INTRODUCTION TO ADOBE FLASH CS4
Animate Workspace. Objective % Utilize appropriate tools and methods to produce digital animation.
lecture 8 Our First Project
UNITY TEAM PROJECT TOPICS: [1]. Unity Collaborate
Tutorial 6 Creating Dynamic Pages
Computer Animation UV Mapping.
Exercise 30 - Skills Fireworks uses layers to help you organize and work with the various elements in your drawings. You can us layers to keep objects.
INTRODUCTION TO FLASH ANIMATION
Computer Graphics Imaging Ying Zhu Georgia State University
Introduction to PowerPoint
EEC-693/793 Applied Computer Vision with Depth Cameras
Directions are in slide notes. You can view them in two ways
Using Animation and Multimedia
VISUAL COMMUNICATION USING ADOBE PHOTOSHOP CREATIVE SUITE 5
PowerPoint is for making high quality presentations
PowerPoint Practice Exercise
ANIMATE WORKSPACE Stage Timeline Properties Panel Library Panel
Creative Inventions and Robotics
4.00 Apply procedures to add content by using Dreamweaver. (22%)
Presentation transcript:

2D Graphics and Animations in Unity 3D Finally, something visual! Unity 2D Game Development Telerik School Academy http://academy.telerik.com

Table of Contents Sprites Animations Particle Systems Layers * Table of Contents Sprites What is a Sprite? Importing Sprites Sprite Editor Sprite Renderer Animations Creating Animations Animation State Machine Particle Systems Layers (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

What is sprite and where it is used? * Sprites What is sprite and where it is used? (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

What is a Sprite Sprites are: Two dimensional image or animations * What is a Sprite Sprites are: Two dimensional image or animations Integrated in larger game scene Usually used from sprite sheets for performance considerations Used in 2D games You can find free sprites in http://opengameart.org (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

What is a Sprite Sheet What is Sprite Sheet: * What is a Sprite Sheet What is Sprite Sheet: One image with collection of sprites Using them like one but cutting wherever needed Can be used to create animations Must watch video for sprite sheets https://www.codeandweb.com/what-is-a- sprite-sheet (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to Import in Unity In the Project browser Create folder "Sprites" * How to Import in Unity In the Project browser Create folder "Sprites" Use drag'n'drop or just copy the sprite image in the corresponding explorer folder You can now see it in Unity On the Inspector there are variety of options for the sprite (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to Import in Unity In the Inspector * How to Import in Unity In the Inspector Make sure "Texture Type" is "Sprite 2D" Set "Sprite Mode" to "Multiple" in order to tell Unity to use the image as collection of sprites In the "Max Size" option consider the maximum resolution used by your game If you think the size is too much, change it and click "Apply" You can define different sizes for the different platforms (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to Import in Unity "Pixel To Units" option * How to Import in Unity "Pixel To Units" option Unity does not use pixels for its calculations but rather than that uses units Each unit is what you define – for example 1 unit = 1 meter in your game The smaller is the value, the more performance issues you will have with the Physics Engine "Pixels To Units" also define the default scene view grid – easier to arrange when your sprites' width is exactly the "Pixels To Units" ratio (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to Import in Unity Select "Sprite Editor" for magic * How to Import in Unity Select "Sprite Editor" for magic On the "Slice" button you have the following: Type - "Automatic" and "Grid" – how to cut Pivot point – where are the zero local coordinates of the sprite Method "Delete Existing" – remove previously sliced "Smart" – will create new rectangles by adjusting "Safe" – will only add rectangles without touching the originals (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

How to Import in Unity If you have any problems * How to Import in Unity If you have any problems Define the rectangles by yourself or Try to rearrange the sprites with some tool TexturePacker should do the job: https://www.codeandweb.com/texturepacker Click "Apply" in the top right corner Go to the "Project" window and see the results (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Sprite Renderer If you drag'and'drop a sprite into the scene * Sprite Renderer If you drag'and'drop a sprite into the scene You will see the "Sprite Renderer" component Color – you can adjust the color of the sprite Material – used for the 3D Physics mainly Sorting Layer – how sprites overlap on the scene Order in Layer – if the sprites are in the same layer, how they should overlap on the scene (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Animations Very power, much cool! * (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Creating Simple Animations * Creating Simple Animations The easiest way to create animations Select all the sprites you want to include Drag'n'drop them all at once in the scene Unity will prompt you to save the new animation Create folder "Animations" in the "Assets" folder and save it there Run the game  (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Adjusting Animation Select "Window" -> "Animation" * Adjusting Animation Select "Window" -> "Animation" Select the game object you want to adjust You can select each frame and apply the timing you need By clicking "Add Curve" you can add Position and Rotation animation Color animation Scale animation (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Adjusting Animation By default all animations should loop * Adjusting Animation By default all animations should loop Sometimes however we do not want the loop Go to the "Project" window Select the animation file In the "Inspector" disable "Loop Time" The animation will now play only once (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Object With Many Animations * Object With Many Animations Currently all animations are different objects To assign one main object with different animations: Select "Game Object" -> "Create Empty" To make it visible -> "Add Component" -> "Sprite Renderer" Drag'n'drop an initial sprite to the renderer The same way add "Animator" component Each Animator need state machine called "Animator Controller" (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Animation Controller To add "Animation Controller": * Animation Controller To add "Animation Controller": In the "Project" browser – create new "Animations Controller" Or just drag'n'drop all the animations to the Game Object and controller will be created Select "Window" -> "Animator" to see the state machine of the currently selected object (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Animation Controller Making animation transisions * Animation Controller Making animation transisions Double-clicking will open animation properties Right-click on an animation -> "Set Default" Right-click on an animation -> "Make transition" Think carefully how you want your animations to transition between each other (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* Animation Controller Clicking on the transition arrow will open some settings Mute – disabled animation state Solo – enabled with respect to other states Transition Time – how smoothly the transition will happen (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* Animator Parameters In order to transition the animations through C# code, we need parameters In the lower left corner click the "+" sign You can choose between "float", "int", "bool" and "trigger" Give the parameter name and set default value Later in the code you can change these values (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

* Animator Conditions We need to select each transition and set its conditions depending on the parameters value Select a transition and go to "Conditions" Default is "Exit Time" Click the "+" sign and choose the parameter Click the value you want Do this for all transitions carefully You can change and preview during run-time (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Particle Systems A hole bunch of effects! * (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Particle Systems Most solid game objects are fine with sprites * Particle Systems Most solid game objects are fine with sprites Most there are other game elements Like water, fire, clouds, explosions, etc. These are hard to make with sprites Here comes the built-in particle system effects (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Particle Systems Each particle * Particle Systems Each particle Has a predefined lifetime During it can undergo various changes Is emitted at random position from predefined shape at certain rate Has velocity vector to determine the movement Color, size and rotation can be changed too Using combinations of all above properties can give you various "cool" effects (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Particle Systems Each particle * Particle Systems Each particle Has a predefined lifetime During it can undergo various changes Is emitted at random position from predefined shape at certain rate Has velocity vector to determine the movement Color, size and rotation can be changed too Using combinations of all above properties can give you various "cool" effects (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Particle Systems Go to "Game Object" -> "Particle System" * Particle Systems Go to "Game Object" -> "Particle System" A default Particle System will be created Options have these variations: Constant – fixed over the lifetime Curve – specified by a curve/graph Random between two constants Random between two curves Gradient Random between two gradients (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Simple Explosion To create a simple explosion Create Particle System * Simple Explosion To create a simple explosion Create Particle System Import Particles assets from the standard assets Assets -> Import Package -> Particles Go to "Renderer" module, set the material to Fire Add Disable "Cast Shadows" and "Receive Shadows" Go to "Emission" and set the rate to 0 Add a single burst of 50 particles at 0 time In the main module set "Duration" and "Start Lifetime" to 1 (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Simple Explosion To create a simple explosion * Simple Explosion To create a simple explosion Check "Size Over Lifetime" and use the "ramp-down" preset Check the "Color Over Lifetime" and set white to black gradient Check "Limit Velocity Over Lifetime" and set "Speed" to 3 and "Dampen" to 0.4 Set "Start Size" random between 0.5 and 1.5 Set "Start Rotation" random between 0 and 360 Enjoy  More here: https://youtu.be/Bg-Wybm93Pk (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Layers & Tags Unity Layers * (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Layers "Layers" in top right corner -> "Edit Layers" Normal Layer * Layers "Layers" in top right corner -> "Edit Layers" Normal Layer Can be used for collision detection Sorting Layer How the objects overlap on the scene Tags Used for identifying objects from the code Every object may have layer or tag (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Summary Animator State machine - transitions * Summary Importing Sprites – why and how Animating Sprites – animation window Animator State machine - transitions Particle Systems – a whole new world Layers and Tags – label your objects (c) 2007 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

2D Graphics and Animations http://academy.telerik.com

Free Trainings @ Telerik Academy C# Programming @ Telerik Academy csharpfundamentals.telerik.com Telerik Software Academy academy.telerik.com Telerik Academy @ Facebook facebook.com/TelerikAcademy Telerik Software Academy Forums forums.academy.telerik.com