Updated with a "fix" today. Maybe you should skip the first part.
Hi there,
This is a follow up of this thread...: Trying to use bounding box with weighted vertices, but...
...but that's just FYI. The purpose of this new thread is not to insist on the weighing for bounding boxes, not even talking about bounding boxes anymore.
It's about making colliders actually clickable when they're accompanying a bone follower. I just can't make it happen.
The only thing I've done is to add a Box Collider 2D here...:
...because at the very least I'd like for the collider to accompany the head in this case.
But the EventSystem doesn't report any event for it whatsoever. No MouseEnter, Exit, Down, etc. So, of course, nothing happens in this FSM machine:
As a desperate move I've created a Box Collider (3D), instead of a 2D, and I got this...:
The mouse down events happening is just because I'm clicking like crazy, so some of them are detected. But yeah, it's constantly "entering" and "exiting", and only with the 3D collider.
Then, as a last test to confirm I'm not crazy, I put a 2D collider on the skeleton object, outside the SkeletonUtility hierarchy, and it started to work as expected:
Then I remembered that detail from the other post, in which you guys mentioned the collider was constantly being destroyed and recreated in each frame, but... I'm not using a bounding box or anything.
I just attached the thing to the bone follower because I want the collider being translated with the head, at the very least, lol.
So, is this even possible without resorting to dirty tricks?
Thanks!
Update:
I'm fresh after some sleep, and I've realized I never told you this bone follower and collider are inside this hierarchy:
...and that might be the cause of the problem, because I've created a separate object outside that structure...:
...like this...:
And now it works perfectly. The collider follows the Head bone and it's interactable.
So, my guess is that the sum of all the parent bone followers messes up "something" in the collider position?
And that also makes me question the actual utility of making that hierarchy in the first place? For this specific use case with clickable colliders, at least, I mean.
For this...:
...to work, yes I recreate the same hierarchy of bones as I have in Spine. They're a "look at" system almost identical to Spine Boy "aim" feature.
But it seems doing that for a collider to just follow a bone is not needed and even problematic. Could you confirm this?
Thank you!
Update 2:
Oh my god...:
I'm stupid!!!!!!
Okay, that's NOT a BoneFollower component, lol. I've been thinking it was because it's also follows the bone, but it's not the same freaking thing. :wailing:
How many hours I lost because of my lack of reading skills. Now I'll go to a corner to drench in my shameful tears.