|Simon Lus (notallowed)||13.04.2017 22:39|
I have a simple question what is multiplayer equivalent for "g_currentMission.player.lastFoundObject"?
I am trying to get object which player has in range and can pickup.
I am printing tables of g_currentMission to log but it seems I can't find anything related to this o.O
|Emil Drefers (Unknown)||18.04.2017 06:54|
this variable holds an "objectId" (or "nil"), depending on what the player looks at.
So, for example if a player looks at a piece of wood this variable should have a valid value.
This variable is synchronised from the server to the clients.
|Simon Lus (notallowed)||21.04.2017 00:08|
first thank you for a response.
Well yeah meaning of it is quite self explanatory, however it doesn't appear that variable is synchronised (at least not in my case). Because I was intending to use this in my script, however there was a problem in multiplayer, as this variable was always nil. My condition looked like:
if g_currentMission.player.isObjectInRange then
if g_currentMission.player.lastFoundObject ~= nil then
-- my code doing sth with this object
|Emil Drefers (Unknown)||24.04.2017 07:06|
sorry my bad, I did not look close enough.
'lastFoundObject' is not sync'ed, but
'isObjectInRange', 'lastFoundObjectMass', 'isCarryingObject' are sync'ed
If you really need 'lastFoundObject' you could extend the Player script to synchronize that variable too.
Note: Log in to post. Create a new account here.