Skip to main content

Posts

Showing posts with the label Unity

Creating 2D Animation For A Side Scroller In Unity3D

Update 3-13-14 Unity kinda released some really nice 2D tools, I really don't know how relevant or helpful this is now. I've been working on a 2D side scroller. Being my cheap self I'm not going to bother buying some helpful tool that would probably speed up everything a substantial amount, and created my own method of 2D animation for things in Unity3D. This code does not work with a sprite sheet, but I hope it makes it easy enough for you to incorporate one if you wanted to. Warnings:  The animation is displayed by updating the meshes material's texture each frame (this can mess up at high frame speeds). This code is assuming the 2D sprites are moving along the X and Y axis. When changing directions, it is scaling the transform negatively across it's x axis. Its assuming default direction facing is right. using UnityEngine; using System.Collections; public enum Directions{left,right} public class FlatCharacterAnimation : MonoBehaviour {...

Importing Models and Animation From Blender

NOTE - If nothing is showing up in your preview section, then you have exported the model wrong. Remember you need to have selected in Blender what to be exported. If you have done this, try reversing the faces in the model and re exporting. So after you have your model from Blender rigged , animated , and exported, you can bring it in to the unity editor.  Scale factor is by default 0.01, to change that, try looking at this link .  Anyways, your going to want to drag you model to your scene and adjust the scale factor till you have the desired size (scale factor 1 is rarely what you ever want it, its huge). To start defining your animation, click the + button that's highlighted purple in the picture. You'll get something like this where you can name your animation, define starting and ending frames, and wrap mode. Remember back when you were making the animation for your model? you had to define frames and you had a certain amount of frames ...

Making Classes..

A dip into JavaScript. Before I begin. var is a variable. You need to declare your variables before you start writing code so the code will execute properly. Declaring a function goes like this: function Update(){ //Insert your code here.... }

First Blog...

Well, its going to be about creating games on Unity . I am relatively new to the interface and JavaScript. But I have gotten used to it through great tutorials and scripting references . I am going to be developing a simple (or at least at first.) video game, and keeping track of it on this blog here. Unless your at least relatively familial with Unity, you might want to watch all the tutorials (Yes I know its alot) to understand exactly what I am talking about.