• Editor
  • (unity) questions

Hiya,

I was wondering if there's a way to cache a certain object in unity so we can attach a sword or weapon to the hand which can change? Also it is important to us to be able to attach individual colliders to those things as well.

As far as I understand no game objects are used, but I was wondering if it's possible to retrieve the transform of a bone in its current state?

Related Discussions
...
  • Đã chỉnh sửa

You can attach multiple images to a slot in Spine and change between the images at runtime using Skeleton SetAttachment. You can get a bone using Skeleton FindBone and access its world rotation, scale, and translation. You can use this to position a gameobject or collider.

Is there anyway in the runtime to get at this list of valid images for a slot?

Yes. See Skin FindNamesForSlot and FindAttachmentsForSlot. Attachments not in any skin in the editor will be found in the default skin (eg skeletonComponent.skeleton.Data.DefaultSkin.FindNamesForSlot("slot name")). Otherwise they will be in the appropriate skin (eg skeletonComponent.skeleton.Data.FindSkin("skinName").FindNamesForSlot("slot name")).

Sorry I know this is a unity question but are you certain this is in the c runtime? I can't find it with a search of FindNames.

You posted in a Unity thread so you got a spine-csharp answer. 🙂 There isn't a way to get a list of available names in spine-c. The internals of Skin aren't exposed and there are no find*ForSlot methods. You could do a github pull request to add them.

Hình ảnh bị xóa do không hỗ trợ HTTPS. | Vẫn hiển thị

Hiya, thanks for quick response. I had another question:

Is it possible to trigger a callback on a certain frame, or call a function when enough time has elapsed? I'd like to for example, play a footstep sound when the foot hits the floor, or fire a bullet when the gun is at a specific frame/time.

If so, what would be the best way of going about it?

Thanks for your time.

Nate đã viết

You can attach multiple images to a slot in Spine and change between the images at runtime using Skeleton SetAttachment. You can get a bone using Skeleton FindBone and access its world rotation, scale, and translation. You can use this to position a gameobject or collider.

Didn't know this. This will help me alot of headache. When will documentation be presented? I thought I had it down but didn't know about the FindBone SetAttachment was about.

@hippocoder, that would be the Event Timeline task on the Trello board.

@ZacCom, runtime documentation will come pretty soon.

5 ngày sau
hippocoder đã viết

I'd like to for example, play a footstep sound when the foot hits the floor.

I too would like to know how to do this please. 🙂