#Animation Code
1 messages · Page 1 of 1 (latest)
why are you doing
GetComponent<Renderer>
if there is no normal renderer?
and if you are using a sprite renderer you want to have a array of sprites not textures
@proven swan
then you can use
.sprite = mynewsprite;
how can I pause an animation, I feel like there is literally no solution to this problem?
this thread is not about your problem
well, it fits; anyways sorry
No idea, trying anything to make it work. Thought <SpriteRenderer> may work instead.
SpriteRenderer is the correct thing
But the variable has to be Texture2D[] to select them then
if you want to use a sprite renderer you have to import the images as sprites
As you can see on the right pane I'm using Sprite Renderer
And in the Mover script I'm selecting each frame for the animation, so in the code I'm using Texture2D[] variable, how can I then make it work with GetComponent<SpriteRenderer>() ?
Texture2D[] is if you use a normal render with a material
if you use a sprite renderer you have to use a
Sprite[]
and import the image you want to use as a sprite
Wow, thank you! It worked
looks like this advice on the net was about normal render as you said, and that Sprite Renderer is something else, thanks a lot! I was struggling with that for hours 