[SDK 3.10.3-beta.1] Scale raycast distance based on source scale
ZenithVal
When a Gameobject with a VRC Raycast component scales, the ray distance should optionally scale with it. This would be useful for keeping raycast distances proportional to the avatar scale. This could be a toggle on the component?
Example scenario: A raycast on a gameobject at the avatar's chest bone with a distance of 0.2. If the avatar is scaled up, this raycast is now doesn't reach outside of the body.
The current solutions for this (animating the distance based on the scale parameter or making the distance unnecessarily large to begin with) seem like they'd be negative to performance.
This ability would also be very useful for those distributing prefabs to less technical users. The user installing a prefab with a raycast just has to scale and adjust it into position on their avatar ~ no need to find the component to adjust the distance.
Log In
RuneFox237
I believe this would also mimic the behavior seen on contacts where they also scale when the gameobject is scaled, up to the 3m radius maximum. Raycasts could do something similar w/ their 1000m maximum. If an asset creator needs the raycast to stay a fixed size while everything else scales, they could also stick it inside a static scale constraint.
Pokerface Cactus
Agreed this should be a thing for convenience sake. tho for your usecase i wouldn't worry about the performance too much. the difference between a 0.2m rangecast and a 2m raycast is pretty much completely negligable and i'd imagine should be plenty for your example usecase at least
ZenithVal
Pokerface Cactus Fair enough! Would love to make some performance benchmarks for these at some point.
I'm making use of
Disable On miss
so with a tiny range, the collider/contacts only become active if they're close enough to start interacting.