- Home /
Move child gameobject in x axis (Lerp)
Hello Everyone,
I have a player script attached to P1(gameobject). I have a sprite mask as a child in P1health(gameobject).
in my player script attached to P1, I have current health and max health so i am creating a percentage upon each hit. The problem is I am trying to move the sprite mask when my percentage is changing. I have searched everywhere but I am not able to solve this. For example:
Initial position(x value) of sprite mask is 9.1 (full health) final position(x value) of sprite mask is 1.4 (zero health)
I am trying to move the sprite bar as the percentage is going down between these 2 values mentioned above.
I hope someone can help me. Kind regards,
Answer by unity_Iz_GKcCCN6sorQ · Oct 19, 2019 at 08:45 AM
Can any one help me? Thanks Again.