Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player A duplicates player B object being held #5

Open
treendy opened this issue Aug 16, 2018 · 5 comments
Open

player A duplicates player B object being held #5

treendy opened this issue Aug 16, 2018 · 5 comments

Comments

@treendy
Copy link

treendy commented Aug 16, 2018

Hi,
I tested out last night and worked great... my friend had an issue where his grip didnt work for his right controller (but that may be a separate issue anyway, or may be a fault with his controller), also, the door is locked closed (but i guess that is a puzzle thing maybe)?

Only issue i noticed, was when my friend picked up the gun... i was suddenly holding a gun also... same for a green cube (and probably other objects)

I havent had a chance to look into the reason yet, but let me know if you have any ideas

@quintesse
Copy link
Owner

also, the door is locked closed (but i guess that is a puzzle thing maybe)?

That's weird, for me the door opens really easily. In fact I can shoot it with a gun and it will bounce open.

my friend had an issue where his grip didnt work for his right controller (but that may be a separate issue anyway, or may be a fault with his controller),

That might be related to this VRTK issue perhaps: ExtendRealityLtd/VRTK#1866

Only issue i noticed, was when my friend picked up the gun... i was suddenly holding a gun also

I'll see if I can replicate that. Haven't seen that behavior before. Could you give some more detail?
What did you see exactly? For example when your friend grabbed the gun, did you see a gun in his hand? Or what you saw was that instead of that gun moving to his hand it moved to yours?

@treendy
Copy link
Author

treendy commented Aug 30, 2018

Hi, sorry for the delay in getting back.

I tested again, basicly my friend picks up the gun, i dont see it in his hands, however, i seem to be holding the gun... ill do some more testing soon... i think its some kind of ownership issue maybe??

..its strange... the green cubes work fine (i can see him holding it), but the gun, he picsk it up, and i can see it in my hand and not his.

I cant seem to see any differnece between the cube and gun that would cause this??

@treendy
Copy link
Author

treendy commented Sep 1, 2018

ok, have played around a little more, found a difference with the green cube and gun.
When you press pause and in editor you click the green cube or gun, it shows the following in the hierarchy...

  1. The green cube is still its own object
  2. the gun is no long its own object, but is instead a child of your controller hand

Im strugging to find a setting to still share the gun location when its picked up... and still unsure why the other player on the network can see the gun in his hand and not mine : (

@quintesse
Copy link
Owner

I still haven't been able to reproduce this problem locally, I'll have to set up a second system. But the cube and the gun are indeed treated differently. That's done on purpose to show the different GrabAttach mechanisms that VRTK supports. The gun gets made a child of the controller so there's no need to share it's location across the network because the controller is already tracked! The problem you're seeing if that it gets attached to the wrong hand somehow. Did you perhaps make any changes to the Avatar model or the setup scripts?

@treendy
Copy link
Author

treendy commented Sep 2, 2018

Hi, I havent made any changes to the model or setup scripts.

Here are the details of my tests just now:
1: Build and run project
2: once it is running, tab back to unity
3: run the project (so now have two version running on same PC)
4: in Hierachy, expand VRTK_SDKManager >> VRTK_SDKSetups and click VR Simulator, then tick the top box in inspector to enable it (so we can now move the cam around on screen to see both players
5: tab back to the running exe version and pick up a gun (I move the window out of the way so i can see the unity project running too

result:
Player 1 (the player that is on the exe version) grabs a gun, can see a gun in his hand fine, and can shoot fine no probelsm

Player 2 can not see any gun in player1's hand, but when looking at his own hand, he can see the gun... he can not shoot... however, when player1 shoots, player2 can see the bullet come out of player ones hand as it should

When you pause unity, and look in Hierachy, if you click the gun, you can see it is a child of player2's hand now (and nothing is in player 1.. the player for the unity running project is player 2)

My thoughts:
It seems when an item is picked up, that it is assigned a parent... but could that parents ID be the same for all players, so the script is sending a network command saying to attach the gun to object X which is the main players hand ID so all players will see the gun in their own hand but not the person who picked it up??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants