justrunner

i have a spine file .the art add ColliderBone 。

we are make a STG Game.
so i wang the bullet shoot the enemy body.
this picture is a boss.


img_v2_4fbe1041-321e-4192-b4d8-2a2d140bbc2g.jpg


i play animation1 i want it can hide the other collider . but i don't know how.

img_v2_9d095983-5b61-4fcc-8283-6c5f8ebe07fg.jpg

some colldier can follow the anim but else need hide .
img_v2_e1ae33f7-033d-4b33-9551-000b89af87dg.jpg


i want hide the collider when the bone not render .
or you can tell what's the right way .to hide
You do not have the required permissions to view the files attached to this post.
justrunner
  • Posts: 1

vhristov

I have been able to achieve something similar (it was an sprite not a collider but it should not matter I think) by using a workaround with BoneFollower and scaling the bone to 0 (zero) in animations that the sprite shall not be visible.

There were a few times that I had need something similar to what you requested, but I had never managed to formulate what my exact needs are, nor how it shall be done.
I think it is a good idea to share my thoughts here, so the spine masters could help at least with the formulation of the idea.
  • I have been thinking of something like SlotFollower, but as far as I understood it there is no such thing as "position" for slots, but it could be quite useful for enable/disable gameobjects.
  • I have been thinking of something like AttachmentFollower, but have never completed a full idea here (it is something like the SlotFollower above, but enable a GameObject when the attachement is attached in a slot) They shall have some kind of a possition/rotation I guess?
  • As far as I understand how spine is working, there is no such thing as bone is not rendered, so there is no way for a bone to control GameObject's enable/disable state (maybe the only exception here are skins, but I am not too familiar with the implementation details of how bones are used when they are exclusive for a given skin).
vhristov
  • Posts: 49

Nate

You could use events to hide/show colliders. If your colliders are based on Spine's bounding boxes, you would hide/show the collider when the bounding box is hidden/shown. Even if not using bounding boxes directly, you could create bounding boxes in Spine (eg using 3 arbitrary vertices), but use them only to hide/show your colliders with the same name.
User avatar
Nate

Nate
  • Posts: 12131


Return to Unity