Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
132 stars 2 forks source link

Equipping an avatar via Grab + Context Menu doesn't clear Grab Anchors #2533

Open Zyro1331 opened 1 month ago

Zyro1331 commented 1 month ago

Describe the bug?

When you equip an avatar by holding it and then using your context menu to equip it, the previous avatar you were wearing will still have it's Grabber assigned to the previous wearer. 347988059-87bedad8-bd42-40e1-9f8f-8585648efc28 (Image of a Grabber still active on an unequipped avatar) This causes parts of the avatar to be bugged out, such as the action of deleting it via inspector will cause the avatar to destroy the user who previously equipped it.

To Reproduce

This bug requires another user to be present in the world. If you are performing the steps in a session alone, this bug will not occur. This was only tested in Desktop mode as well, which might be another lead to the root cause due to how gripping behaves differently.

  1. Create a session and have another user join it.
  2. Spawn an avatar, it needs to be a full-body avatar. "Head and hands" avatars don't seem to exhibit the same behavior.
  3. Equip the newly spawned avatar by grabbing it and using the Equip Avatar button in your context menu.
  4. In the now equipped avatar, try to grab the previous avatar you were in. You'll notice your laser only sticks to it, instead of properly moving it around.
  5. Attempt to delete the bugged avatar. It will immediately respawn you as well, even if you aren't holding it.

Expected behavior

The previous avatar should clear it's grab anchors after another avatar is equipped in this manor. Otherwise, the avatar still has references to the user who previously wore it, and makes weirdness occur.

Screenshots

Here's a video of me using the reproduction steps above, I have secondary computer connected to the session as the other user in the background to make the bug reproducible:

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/49619936/64f21bce-d915-43d1-93c6-b9658b2a6c81

This also demonstrates the destructive behavior being tripped upon deletion, which causes me to re-spawn and immediately fall below the ground.

Resonite Version Number

Beta 2024.7.10.1399

What Platforms does this occur on?

Windows

What headset if any do you use?

Desktop

Log Files

Here's both log files from both clients. Starting with me creating the session on my desktop, inviting my Steam Deck to the world, and then recreating the issue above before exiting.

MANGOVRG - 2024.7.10.1399 - 2024-07-11 10_42_57.log ZYROS-DECK - 2024.7.10.1399 - 2024-07-11 10_43_08.log

Additional Context

A similar destructive behavior can also be seen when deleting an equipped avatar's Tool Anchors or Grab Anchors, which could also be a root cause as to why this happens. When this was discovered.

Reporters

Discovered by @dabloodyresh on Discord Looked into by @jackthefoxotter Additional help with discovery by @epicEaston197 Recreated and Reported by @zyro1331

epicEaston197 commented 1 month ago

I would like to also mention that I was in the same session as this was discovered and I suspected That the avatar protection was being tripped somehow

shiftyscales commented 1 month ago

This issue seems to be a regression related to the functionality added in #2111 by @Frooxius.

shiftyscales commented 1 month ago

I had a chance to test this issue in VR just now nd found that I could not replicate it. Could you isolate the conditons further and identify if there are any more specific criteria that cause this issue, @Zyro1331 @epicEaston197?

Zyro1331 commented 1 month ago

@shiftyscales We've been investigating more on it to narrow the behavior. So it's not SimpleAvatarProtection that is triggering it, as unprotected avatars cause the same destructive issue. My second theory was correct. As it appears the Grabber isn't being cleared from the previously equipped avatar, thus causing the avatar to be non-grabbable and also making the avatar destroy the user who's grabber is still active on the bugged avatar.

image "A similar destructive behavior can also be seen when deleting an equipped avatar's Tool Anchors or Grab Anchors, which could also be a root cause as to why this happens."

I had a chance to test this issue in VR just now and found that I could not replicate it. Could you isolate the conditions further and identify if there are any more specific criteria that cause this issue, @Zyro1331 @epicEaston197?

There's a chance that it could be Desktop only, as the grab spheres interact differently in desktop mode. Also, did you test with another user present in your session? As interestingly enough, it doesn't occur when alone.

Zyro1331 commented 1 month ago

I updated this issue with the new findings, as SimpleAvatarProtection doesn't seem to be related at all. Any full-body avatar can inhibit this issue under the correct conditions.

shiftyscales commented 1 month ago

I see- I was alone at the time- I had forgotten about the detail of multi-users being a requirement as it had been several hours since I had read this post at the time.

Is there a dependency on whether it is the host, or a client doing the equipping, @Zyro1331? Or does it break no matter what as long as there are multiple users in the session?

Zyro1331 commented 1 month ago

@shiftyscales It doesn't matter if it's the host or the client performing the reproduction steps. It happens as long as there are multiple users present in the session. Due to the fact that the user's Grabber is still attached to the idle avatar, other users will still be able to grab the bugged avatar except the for person who previously wore the avatar. As the Grabber attached to it will still be assigned to them on the idle avatar.