Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Can I attach a Particle emitter to a Spine bone's position?
  • Hi peeps.

    Does anyone have any experience making a particle emitter following a spine bone?
  • 1 Comment sorted by
  • @Mikkel there is a tutorial with all the information you need to accomplish this:

    It says:

    "Add the Spine Renderer's calculated position to the "worldX" or "worldY" position of the Skeleton's bone to get its exact location in the scene. It is just a matter of adding up the values in an expression like such for the X values: (Self.Renderer.bones.hand.worldX + Self.Renderer.transformationMatrix.tx) * Self.Renderer.scale.x. or (Self.Renderer.bones.hand.worldY + Self.Renderer.transformationMatrix.ty) * Self.Renderer.scale.y for the Y values. You could leave off the scale value if the Renderer has not been scaled because scale would just be 1."

    So you would just need to use a constrain property action and set the particle emitter's position to the expression below:

    setPoint( (Self.Renderer.bones.hand.worldX + Self.Renderer.transformationMatrix.tx) * Self.Renderer.scale.x), (Self.Renderer.bones.hand.worldY + Self.Renderer.transformationMatrix.ty) * Self.Renderer.scale.y) )

    Replace the name of the bone in the expression with the name you have for the bone you are trying to access. Make sure your bone names do not have any special characters or spaces in them.

    You will also need to check that the property Self.Renderer.bones "is set" using a rules component before executing the constrain property action because the Spine renderer takes a few frames to parse the Spine skeleton data and get setup. This is just so that you don't get null errors on level load.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion