[Feature request] Add an Avatars 3.0 component to measure the distance between two transforms
complete
Haï~
This is an Avatars 3.0 feature request.
As an avatar creator, I would like to be able to measure one or several distances between 2 transforms of my choosing.
Those distances would be calculated each frame and would be exposed to the playable layer animators.
An optional choice would be provided so that the measured distance in Unity units could be inverse lerped into a normalized distance between 0.0 and 1.0 based on a minimum and maximum distance that I would set in advance for that measurement.
Additionally, if at least one of the two transforms is disabled, then the measured distance is always 0.0.
By exposing a method to measure one or several distances on the avatar, I could make:
A: Pocket items. Measure the distance between the hand and a pocket. When the hand starts doing a fist gesture near that pocket by comparing the distance, the animator drives a synced boolean to put an item on that hand, making it seem like an object was just picked up from that pocket.
B: Clap hands particle without collider. Measure the distance between the two hands. In the FX layer, add a condition so that whenever the measured distance ends up below 0.3 units, a hands clap particle can be seen.
C: Distance-based emissive material. Read the distance between the hand and another object on the avatar, with a minimum distance of 0.2 and a maximum distance of 2. An animation with Normalized Time reads that normalized distance, and animates the color of a material, making it emissive as the hand becomes close to that object.
D: Velocity measurement. Every tenth of a second, two transforms are moved around alternatively based on the hand position. By measuring the distance between the two transforms, we can deduce the velocity of the hand, and play an effect based on that hand velocity.
E: Scale an object based on distance. In the Gesture layer, an animation with Normalized Time or a Blend Tree reads the normalized distance between the two hands in order to scale that object linearly.
Log In
Fax
complete
Thank you for pointing out that
VRCContactReceiver
fulfilled this request for you!Haï~
🎉 Fulfilled by VRCContactReceiver of type "Proximity":
kafeijao
Since the removal of particle drivers in child animators (which broke a bunch of features I had on my avatars) I've been struggling to get motivation to get in unity and create more stuff. It was the base block for a lot of things I had. I don't want to go back to the pre SDK 3.0 era way of doing things with mega hacks, dropping performance, and not being able to synchronize stuff.
This should be a very light weight and simple solution that opens so many doors in avatar creation. It sucks having hands tied, this might not be usable directly by every avatar creator, but fortunately there are a ton of people that make prefab systems and tutorials that enables beginner avatar creators to take advantage of it.
I am sorry for this little rant, but I really wouldn't like something like this to fall in oblivion.
Wakamu
Just a small comment on a feature that could be added to that, is the ability to also measure the distance between the player with said transform.
Basicaly, if you only select a single transform, the value becomes the distance between You and said transform, adding interactivity with other players, playing animations when you touch someone for exemple (Slap!)
Lyuma
I want to make clear for the purpose of this canny, this is to solve
interactions with my own avatar
, and I think proposal will work great for self interactions while still providing enough . If we want to discuss cross player interactions
, that would best
be done by a separate proposal, but not sure what such a proposal would look like exactly.Wakamu: you would still be able to achieve your effects in this canny using particles as before: old style stop action effect systems can
still
be used with this proposal when absolutely needed. However, with this canny, the performance overhead of the extra particle system is no longer required except for things that really need particle collision detection. I'd suggest that a separate specialized proposal for cross player detection might be better.lindesu
D isn't so clean because the velocity of a transform will be different over the network than it is locally, when driven by tracker/IK motion, and you have to roughly compensate for that in your animator design-- something that I wish wouldn't be a concern for a velocity measuring system. That said, I think this is an elegant approach that achieves completely replacing what was lost in the last patch, while also opening up new options.