Grab Objects

Share your ideas and feedback to improve our assets!
Post Reply
User avatar
R4microds
Contributor
Contributor
Posts: 2
Joined: Fri Jan 11, 2019 1:44 pm

As the title implies, a simple grab/pickup objects with rigid bodies on OnMouseDown / Keypress. Drag / Rotate / Drop.

This works for the host with Authority but needs to be re-worked for clients:
https://gdl.space/wubenoyoti.cpp
Skoots
User avatar
Lovatto
Admin
Admin
Posts: 1564
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Only the owner of the object (in this case the Master Client) can write and send the information, others just received it,
in order to others can write too, they need request the ownership of the photonview, in photon you use:

Code: Select all

photonView.RequestOwnership();
you call this when the player grab the object, so you inform that this player will start writing in this object.
User avatar
R4microds
Contributor
Contributor
Posts: 2
Joined: Fri Jan 11, 2019 1:44 pm

Works great!

https://youtu.be/BHSaow5nlJU

Thanks Lovatto, another solid addition to this amazing asset!
Skoots
Post Reply