M
M
maxemga2020-11-20 11:09:31
Unity
maxemga, 2020-11-20 11:09:31

How to change the Appearance of an object when a bullet hits it?

I have a box and it can be said that it has 5 forms, the box is normal and the subsequent ones are more and more destroyed, that is, when I shoot at it, I want it to change to the next form (well, that is, to change its appearance) and so on
And how should I do it?
The idea is to make the box Xp and initially put 5 in it, when a bullet hits it, reduce it by one and change the SpriteRender of the Object.
But I don’t know if this method is expedient or better, I also don’t know how to implement this cycle in the code, well, to SpriteRender change
And how to make the box flicker red when a bullet hits it (when you hit it, it turns red and quickly back). Through Animation, that is, turn on the animation when the bullet hits or with the help of Coroutine or what?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question