Spawn actors with health bars
drixz97462
Member Posts: 10
Hello,
I'm just wondering if there's a way to spawn actor with health bars. Currently I'm doing it via the wiki way which sets a game attribute of targetX, targetY that positions the health bar to an actor. However making another actors that spawns the same health bar would result a black screen when previewed.
I'm just wondering if there's a way to spawn actor with health bars. Currently I'm doing it via the wiki way which sets a game attribute of targetX, targetY that positions the health bar to an actor. However making another actors that spawns the same health bar would result a black screen when previewed.
Comments
Again you CAN use the same X, Y for different types of mobs or ever multiple instances of mobs. The program keeps track & constrains it to each instance. I only have 1 game.(X, Y) for all my HP bars.
Presto all done.
What I'm currently doing in summary are as follows:
1. Create game attributes: TargetX and TargetY
2. Set Actor Constrain:: game.TargetX = self.Position.X, game.TargetY = self.PositionY+25
3. Set HP Bar Constrain: self.Position.X = game.TargetX, self.Position.Y = game.TargetY
I would appreciate if someone could point me to the right direction. Btw thanks for your reply JGary321!
I tried to make two different actors to spawn another two different actors on the screen. But it turns out that only one actor would spawn and another wouldn't.
Say there are 4 actors as seen in the inspector, namely Actor 1, Actor 2, Actor A and Actor B. Both Actor A and Actor B are created without any behavior and rule.
Now I want Actor 1 to spawn Actor A, and Actor 2 to spawn Actor B on screen. I created a Spawn Actor behavior for each specifically and then dragged both Actor 1 and 2 down on the scene.
The result: Actor 1 spawns Actor A, but Actor 2 spawns nothing.
The health bars of BOTH Actor'A' and Actor'B' shrinks when ONLY ONE of them is attacked by a mob. Note that both Actor 'A' and Actor 'B' shares the same attributes and behaviors, 'B' can be said as a copy of 'A'.
I have a game variable called game.HP. So when one receives an attack the (game.HP = game.HP -1).
Is there any way to counter this issue?
Seems to be the issue of putting game.Max HP variable as a condition of a rule.