How do I Static healthbar over enemy head.

Get help using Construct 2

Post » Wed Jul 22, 2015 5:49 pm

Please help me, my enemy have working health bar, my only issue is that when my enemy is using another animation the health bar is moving of position too, i want static health bar over the head of my enemy, so my enemy will walk without moving the healthbar too over their head, i am using set position enemy.ImagePointX("health") and enemy.ImagePointY("health") , but my animations have different sizes, i tried to put the same image point position to all my animations and obviously the healthbar is moving with the character then i tried to assign manually the same position of my idle animation ( image point X 47 Y-105 ) to all my animation and didn't work.

The only way to do this was manually edit the image point with my mouse example X 47 Y-105 is the image point position (health) of my idle animation and X 58 Y -113 is the same static position of the image point in my walk animation, i tried "apply to all animation" option but didn't work, the only way to do this is manually?? i have a lot of animation with different sizes and its very hard do this manually with the mouse because isn't precise, and the position X and Y are different with each animation, i cant just put the same X and Y in all animations.
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Wed Jul 22, 2015 5:55 pm

B
46
S
14
G
7
Posts: 603
Reputation: 8,096

Post » Wed Jul 22, 2015 6:05 pm

EncryptedCow wrote:https://www.scirra.com/manual/99/pin

i tried pin before and didn't work because the health bar have the origin point on right side and i cant change it because every damage point will reduce the with of the healthbar, and the healthbar for some reason with pin behavior its on bottom, i want on top, the pin behavior is using the origin point of my animation and all my animations have the origin point on bottom, i cant change it.
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Wed Jul 22, 2015 6:58 pm

i think i solved it, i just created an empty sprite and i set the position of the empty sprite to the character, then i put the position of the healthbar in the image point "health" of the empty sprite, because the empty sprite dont have animations with different sizes now the healthbar dont move it, if someone have the same problem as me this is the solution.
B
9
S
3
Posts: 142
Reputation: 1,108


Return to How do I....?

Who is online

Users browsing this forum: bluesun66 and 11 guests