- Home /
how do I change a 2D Sprite Character Image/Graphic to another Sprite Character Image/Graphic with the same movements, animation,mechanim etc.
Hello, I have a 2D game kit that I bought and have been tinkering with it quite a bit. I'm no 2D expert, Im more of a 3D guy. anyway is it possible to change the 2d sprite character's image/graphics to something else? and if It is, how do I do about it without changing its mechanim or animation or movement etc.?
this is the original Sprite.
http://www.screencast.com/t/gS8GrbwP8
and this is the new one.
Answer by CarterG81 · Jul 06, 2015 at 06:13 PM
I must be confused about the question. Otherwise, wouldn't this be as simple as changing the sprite in the SpriteRenderer?
http://docs.unity3d.com/ScriptReference/SpriteRenderer-sprite.html
[SerializeField] Sprite newSprite;
GetComponent<SpriteRenderer>().sprite = newSprite;
The animation will only effect this if the animation itself changes the Sprite in SpriteRenderer. (Which can be a problem that requires a different solution. Most likely not have any SpriteRenderer data (change) in the animation timeline itself).
You can also have animations on parents of sprites. What I do for all of my game entities is have a hierarchy like this:
-NPC (A root gameObject that holds its children. May also hold AI scripts, character game Statistics (Strength/Health/Stamina/etc.)
--Graphic (SpriteRenderer, Layer adjusting script, etc.)
--Physics (BoxCollider, input interaction/response scripts, anything that deals with collision detection)
For complex graphics, I do the same thing.
-NPC
--GraphicParent
---Head
----Graphic
---Torso
----Graphic
---Larm
----Graphic
---Rarm
----Graphic
---Lleg
----Graphic
---Rleg
----Graphic
By animating the parent fo the Graphic (Head, Torso, Larm, Rarm, etc.) you don't ever move the graphic. So you can move the parent of the graphic.
I'm not thinking about this much, so it may not at all matter logically if you do this. (Is there even a benefit?) I mostly do this to organize my components in a way I can understand and interact with easier in the UnityEditor Hierarchy.
hey yeah actually its just as simple as changing the animation in the animator. I was afraid to try it since Im a begineer, and I though if it doesn't work, then im screwed since im not that smart in 2d
Answer by saberkhalili1 · Feb 28, 2017 at 07:43 AM
Your content is very informative Please see video below Expression and speech training http://mahanteymouri.ir/expression-art/
Your content is very informative Please see video below Expression and speech training http://mahanteymouri.ir/expression-art/
Answer by ariorahimi · Nov 05, 2021 at 12:02 PM
,how can i do it on my images in my website ? what program you suggest ? please check them: خرید پرده زبرا and پرده زبرا ساده
Your answer
Follow this Question
Related Questions
cutout animation in top down view 2d 1 Answer
Pixels per unit with tile palette? 1 Answer
Create an invisible area behind 2D objects. 2 Answers