Ok cool, yea I figured... but it was easier to do a little write-up than pack up a sample project haha. I'll work on getting you something though, thanks for the attention so far!
A little more insight into those thoughts:
BCoroutine.WaitAndPerform
just kicks off a coroutine yea. Normally if that second param is >= 0, it'll do aWaitForSeconds
, then do the action. If you pass in -1 like I'm doing though, it just does ayield return null
(waits 1 frame), then does the action._carryable.DisableRenderingForSpineAttachment(true);
is just disabling the sprite on the in-game pickup object, since we're resource-loading a new sprite to attach to the skel, and we don't want the pickup's image showing on screen twice while the agent is holding it. They're separate sprites, and separate objects - I'm pretty comfortable saying that couldn't be interfering.
EDIT: Hmm just had a quick thought - would it be problematic if the skel was being disabled or enabled in the same frame that the sprite was getting attached? That would be possible in rare cases if the agent was changing face direction in the same frame that they were picking something up, since we use separate skels for their different face directions.
To add little more detail there, for face directions the agent isn't in we disable both the MeshRenderer and the SkeletonAnimation components.
An enabled face direction:
A disabled face direction:
(p.s. I don't know how to make my reply show as a new message! it just keeps showing as an edit to my last message... hopefully this notifies you as if it's a reply haha)