Title pretty much says it all. There’s a slight lag almost like i’m lerping to the new position. But I’m not. Here’s the code I use to set the position. The script is attached to the Controller(Left) and Controller(Right). Another thing to note, this delay does not exist when I move the entire CameraRig only when I physically move the controllers. Vector3.Distance is 0.
void Update
{
gripOffset.position = transform.position.
}
Simple as pie.
I don’t have it as a child because I don’t want gripOffset to rotate with its parent. This works fine between two normal objects. I’ve deleted the SteamVR folder and reimported and I’m using the latest version of Unity. I really don’t get it. If someone with a Vive could try and reproduce this to be sure it’s not something I’m doing, that would be awesome.
Not tested myself, but seems your code executes before the Vive does resulting in your positions lagging one frame behind. You could try using LateUpdate instead or modify script execution order to make sure it happens in the correct order.
Thanks ThermalFusion. I forgot to mention I had tried to use LateUpdate with no success. Another thing to note is the delay was more than one frame, it would take almost a half a second give or take once I stopped moving my hand for the object to reach the controller’s position. I haven’t tried script execution order. I’ve barely tested this (been out of town for a while) but I believe (un)parenting during runtime fixes the issue. Which is convenient because I need to do that anyway. It’s confusing why this works and feels a little hacky so when I get a chance I’ll test execution order and what worked for me again.