ExtendRealityLtd / Tilia.Interactions.Controllables.Unity

Mechanisms that provide physics based and non-physics based linear and angular interactable controls for the Unity software
MIT License
9 stars 4 forks source link

Set Drive value #266

Open olemid opened 1 year ago

olemid commented 1 year ago

Is your feature request related to a problem?

No

Describe the solution you'd like

When syncing a Drive across the network, I can easily sync the value itself, but there's no easy way for me to then use this value to change the state of the other user's Drive. As it is, I need to either use the Target system, or manually set the position/angle of the drive based on the value and the parameters (like axis)

Describe alternatives you've considered

I would like a function like "SetValue" (and maybe "SetValueSilent") that sets the Drive to the correct state based on the value. It could be normalized or not.

thestonefox commented 1 year ago

would this not cause an issue with the joint drive?

because i assume what you're after is:

given a linear drive has a travel of 0 to 10

if the drive is moved on client A then the joint is moved along the axis of the drive

and on client B, the position of the drive is synced immediately to the position of client A drive

But the issue with that is you're not changing the position of the interactable, you're driving it with a rigidbody force along the limits of the joint.

so client B cannot be synchronised without driving the interactable position with rigidbody force (which is what target value is doing)