I’m making a vr sword fighting game and to start with, I decided to try and make the sword of my player get stuck in an enemy. I figured an easy way to do this would be to disable tracking of the hand that got stuck for a certain amount of time. But this gives me a very janky result, definitely looks more like lag instead of what I was going for.
I’m now thinking that a better way would be able to let the player move his hand, and also his body, but restrict it so it seems like it really is stuck. How would I do this? (If you’re going to tell me to use a joint of any kind, please tell me the settings on the joint you would use, I have only used joints once and that was a spring joint for making a grappling gun so I know nothing at all about them)
I think the main thing you’ll need is for something to still indicate to the player Yes, I am still tracking your hand; the sword is not moving on purpose. Maybe a ghostly virtual hand that shows up in the place of your sword when the sword is no longer attached to your hand.
Speaking of which, when this happens, the sword should be no longer attached to your hand. Don’t make the sword BE the “hand”, make the sword a child of the hand. When you want it to get stuck, unparent it via transform.SetParent. (And, maybe, parent it to the enemy it’s stuck in, instead)
I can’t unattach the sword to from the hand because the sword comes from the robot arm of the player, it is quite literally attached to the player. Also, I tried messing around with joints and stuff, but it doesn’t seem like they affect tracking at all. So I think I’m gonna do your ghost hand idea. Thanks.