We’ve been modeling our use of grabbed objects with motion controllers in VR on Robo Recall: feed the motion controller’s location into laggy springs and set the physics handle moving the grabbed item to target that location. Also like Robo Recall, there’s a velocity component tied to a point out at the end of melee weapons that’s used to calculate hit damage and also drive audio and visual effects of melee weapon movement.
Unlike Robo Recall, though, we have continuous movement and in-place snap turns that don’t flash the screen, and I’m having a very difficult time moving the held melee weapons to follow the movements and turns exactly without lag or other undesired effects. Snap turns cause the melee weapon to lag behind the turn, strongly trigger the movement effects, and cause the melee weapon to hit very hard. Calculating the arc of movement of the hand that results from the turn, teleporting the melee weapon, and resetting the velocity of the velocity component almost works, but the melee weapon jumps ahead of the arc some, possibly from the springs, and so doesn’t move solidly with the turn. The jumps also occasionally trigger the effects. Substracting out running motion (translation) is much easier, but based on whether the melee weapon is ticked before or after the motion controller, the melee weapon either “leads” the motion controller and moves a bit ahead of the hand attached to the motion controller, or lags behind a little. I can’t get it to solidly follow the hand either way. Also, the velocity reset when teleporting the held item means that throwing while running forward doesn’t work – the velocity is cancelled out before the thrown item leaves the hand, so it drops in-place and falls behind you.
I’m still trying to calculate all the motions, get the tick order of everything right, and subtract out the motions we don’t want to affect the melee weapons (resetting the laggy up vector on the springs is especially hard to figure out), but it’s taking a long time and still doesn’t look very good. Has anybody else dealt with this issue? Am I doing it wrong? Has this problem been solved a better way, or is there an easier way that should work?