Right well i have a series of 2D Images for example lets imagine you designed it the old fashion 1 drawing then next page change and its legs moved abit well i have that with like 500 images for a old 2d game im recreating what would be the best way to go about adding these in under a playercontrol of say hold down left click it walks and follows your cursor and right click hold down runs and follows cursor.
kaneo1234,
It sounds like you have a series of images which make up some sprite animations. Sadly there is not much 2D specific support in the Unity engine currently. I would suggest checking out the SpriteManager 2 middleware. There seems to be a lot of praises about it on the forums, although I have not used it myself.
you should follow a tutorial like say the 3d platforming one you can find it in the resources section and when you want the 2d Images you should use the Plane and it will have a texture on it you change the texture to your texture but its better to use an atlas that will have all your images in a grid and you can use uv animation search the forums for it or maybe the wiki but anyway you put your atlas texture on your plane and you animate it with scripting and choose the right grid for the right action maybe keep a state variable that can be walk or run or whatever to choose an animation and you use Input uh dot mousePosition and Camera dot main dot ScreenPointToRay and physics dot raycast you can dnif in the script reference that will get your mouse position and where it is on the ground and you can face that way with your character
Cough hack sputter.
This’ll move the character, if you fix it up to work with your current scripts:
var rch : RaycastHit;
if ( Physics.Raycast( cam.ScreenPointToRay( Input.mousePosition ), rch ) ) {
var point : Vector3 = rch.point;
point.y = player.transform.position.y;
player.transform.LookAt( point );
if ( Input.GetMouseButtonDown( 0 ) ) {
player.transform.position += player.transform.forward * walkSpeed;
}
if ( Input.GetMouseButtonDown( 1 ) ) {
player.transform.position += player.transform.forward * runSpeed;
}
}
Edit: Aw, my impact is lessened by the ninja skills of another. SpriteManager is pretty good software, but if you don’t want to pay money you’ll want to use UV animation.