By closest to the shapecast I guess you mean to its middle when multiple things are detected? You can just add an empty child placed in a spot you consider middle and compare distances of detected stuff, may not be the greatest solution but not much effort is being put. About a label, it's a part of UI, you want to keep one button hidden in canvas that gets visible when there's an object in your cast(and hides when there isn't).
#interaction system with hover selection
1 messages · Page 1 of 1 (latest)
yeah i kinda had an idea for that part, the main issue is, how to detect when an item should display it's hovered label? with the setup i have right now, i can only send a signal when i press "interact", but i have no way of knowing if i am colliding an item and if it should be hovered or not
i thought about having a signal for when the item enters my collision and another for when it exits but i don't think that's really possible?
with my knowledge at least
In code responsible for detection emit signal whenever an interaction target changes. You can add a string argument to signal so it can also send the interacted object's name to the label, when there is nothing it sends empty string "". And in the label add a simple check that hides hit when it string == "".
Should work
alright i'm gonna try that
You also probably should change shapecast to an area
damn yeah since i was used to using raycasts for interactions so i assumed i had to use shapecasts for some reason lol but that makes a lot of sense, gonna be way easier with an area i think