Can i parent one actor to another actor?

tetsu0sh0

  • Posts: 49
Is there a way to parent an actor to another actor?
For example, if i want a moving actor to have a health bar above its head?

I have no idea where to begin, i'm very new, Thank you.

dtrungle

  • *
  • Posts: 1938
Do the crash courses/tutorials. Look in the code for starter kits and learn. It's not hard to do what you're asking for.

This forum needs a better FAQ thread...

tetsu0sh0

  • Posts: 49
Well i suppose another question would be have that functionality toggle-able.
Ive been through both crash courses.
Bear with me please

lazyboygames

  • Posts: 485
You can do that by drawing up a rectangle, and set it's x, and y to the players then add and subtract to situate it just right.

Then to make it functional set the width to healthPercentage.

Then set healthPercentage to healthLeft/healthAmount

BTW these are just attributes I am creating.
Also reading the stencylpedia will help.

rob1221

  • *
  • Posts: 9461
Lets say your health bar actor has an actor attribute called Parent Actor.  If your moving actor creates the health bar, then you can use one of the blocks under Behavior > Attributes to set the value of Parent Actor to self (self block is under Scene > Actor).