• Editor
  • Decapitation

Does spine support the removal of parts in real time as I am looking to decapitate one of my fellow warriors! 😃

If so is there an example or concept that can point me in the right direction?

  • Thanks :rofl:
Related Discussions
...
  • Изменено

I would start by labelling the 'head' part, then in your code you can find the head slot

Slot slot = skeleton.findSlot("head");
		   Attachment attachment = slot.getAttachment();
		   if (attachment == null) continue;
		   if (!(attachment instanceof RegionAttachment)) continue;
		   RegionAttachment imageRegion = (RegionAttachment)attachment;
		   imageRegion.updateVertices(slot);
		   
TextureRegion tex = imageRegion.getRegion();

maybe you can turn the textureRegion into a physics object.

I don't know how to remove the head though.

Wow, decapitation. So if this is gory enough, would you be using Spine to animate a bone representing a spine? lol

Lamellama написал

I would start by labelling the 'head' part, then in your code you can find the head slot

Slot slot = skeleton.findSlot("head");
		   Attachment attachment = slot.getAttachment();
		   if (attachment == null) continue;
		   if (!(attachment instanceof RegionAttachment)) continue;
		   RegionAttachment imageRegion = (RegionAttachment)attachment;
		   imageRegion.updateVertices(slot);
		   
TextureRegion tex = imageRegion.getRegion();

maybe you can turn the textureRegion into a physics object.

I don't know how to remove the head though.

I might replace the texture with an empty one and create a new game object for the head + particle effect for blood... Could work... Thanks ! 😃

loneboat написал

Wow, decapitation. So if this is gory enough, would you be using Spine to animate a bone representing a spine? lol

Ah yes haha I guess I would be wouldn't I? :rofl:

12 дней спустя

You can just hide the head attachment image or replace it with a bloody stub. Then you can have a separate bone which you show the head image on and animate.

2 месяца спустя

How can we hide attachment