1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Are game object settings supposed to be compatible with Collab?

Discussion in 'Unity Collaborate' started by dweirich, Mar 11, 2017.

  1. dweirich

    dweirich

    Joined:
    Mar 7, 2016
    Posts:
    2
    Collab has been working great for me except for the settings on game objects. They never seem to get updated. If I add a texture to something on one computer, publish to Collab, then pull it on my laptop, the object will be there with no settings. Is this normal?
     
  2. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    400
    Hi @dweirich! What you're describing is not normal behavior. :( By game object settings, are you referring to the components or the values of those components? Example, when you add that texture, does the Mesh Renderer have a null reference to the texture's material or is it set to None? Can you include some screenshots of the problem to give us a better idea of what's going wrong please?
     
  3. dweirich

    dweirich

    Joined:
    Mar 7, 2016
    Posts:
    2
    Sorry, decided to just develop on a single machine instead. I tested it again and it seemed to have fixed itself for the time being. Thanks for your response.
     
  4. batterj2-bb

    batterj2-bb

    Joined:
    Nov 5, 2013
    Posts:
    11
    We've been suffering from this a LOT in our project and we're only day 2 into using Collaborate.

    An example that happened this morning:
    1. I created a public array of Meshes in a script of a fixed size
    2. I assigned a Mesh to each slot in the editor
    3. Committed my changes
    4. The artist then update his working copy and whilst the array was detected, the values had not been entered
    5. When he entered them back in, no change was detected so nothing to commit back
    So to me it seems there's a disconnect between syncing up assets and then updating the local working copy.

    The artist thinks there's an issue with custom scripts not being synced correctly.
     
  5. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    400
    Hi @batterj2-bb! That's definitely an annoying problem. I'll try to repro that on my end but could you also submit a bug report with this script that has the array of Meshes just so I can be sure that we're seeing the same thing that you are? When you do, could you please post your Fogbugz number here?
     
  6. batterj2-bb

    batterj2-bb

    Joined:
    Nov 5, 2013
    Posts:
    11
    Hi @ryanc-unity

    Ship has sailed long ago in terms of that specific bug but I'm also in agreement that the issue specifically lies with public variables on script components. It's hard to capture because the accidental solution to it is to make a minor modification to the active scene file, commit, undo the changes and commit again. Or have the other person who's not seeing the values carry through update the values themselves. The danger in this however is if you have multiple scripts with multiple new public variables for each commit, as it's very easy to forgot one and then false positive bugs appear on one developer's machine.

    So in summary the bug (and pretty much the steps to repo it) is to
    1. create and attach a new script component to a game object
    2. provide some public variables in the script (without default values)
    3. return to the editor and insert values
    4. commit and have the other developer observe the variables
    Annoyingly it doesn't seem 100% repro success. One thing we have noticed is when we commit it doesn't commit the active scene file if it's been modified but not saved. This might be the reason the values aren't committed if that's where they're stored (I suspect but can't confirm that editing the values doesn't seem to register as a modification). On the one hand this makes perfect sense, why commit something you haven't saved? But on the other, if you are prepared to make a commit on components that are unique to specific instances and that data is stored in the current active scene file, surely it makes sense to add an auto-save to the scene file or at the very least a check to ask to save modifications to that file before proceeding with the commit? Perhaps the scene file and the game objects are too highly coupled?
     
  7. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    400
    Thank you for the extra info @batterj2-bb. This is very helpful!

    You are correct in that scene modifications, which include editing the public variables of scripts, are not automatically listed as changes to Collaborate _unless_ you explicitly save your scene. That's for in case you are making some changes to the scene that you don't necessarily want to commit with the rest of your changes. When you attempt to Publish while you have some scene edits, you should see the following prompt asking if you want to save your scene, not save it and push the rest of your changes, or cancel the operation. In the below image, I both moved the scene file into a new folder and also edited the box collider on the cube, but didn't save my scene:
    Snip20170403_9.png

    Are you and your teammates seeing this window every time you edit your scene and try to publish? (It may hide partially behind the Collab Toolbar, depending on where your Unity window is placed, but you can move it to the side to see it). If not then this could help to explain why your teammates aren't seeing the latest edited values in your scene.
     
  8. batterj2-bb

    batterj2-bb

    Joined:
    Nov 5, 2013
    Posts:
    11
    Crap, didn't notice an alert on this!

    Erm... we've seen it sometimes but I don't think we see it 100% of the time. I'm not convinced it's recognising the modification each time. I'm not sure, even with best intentions and practice, I would remember to save a scene file before committing, especially if it doesn't indicate a modification - does a save even occur if you ask it to save and it's not showing a modification?

    We've literally just had this happen again hours before in an in-studio demo but it was on a prefab rather than the scene. I had assigned a prefab to another prefab's script variable (for instancing) and looking at the Collab history it has committed the owning prefab. Moments later the artist pings me saying I've broken the build and it turned out that the prefab assignment wasn't committed.

    Unfortunately I can't see the diff of that commit so I can't verify that (on a side note: that would be a nice feature, to see what has been changed because developers' comments can be somewhat... vague. E.g. "fixed issue")

    I should probably add the project is currently using 5.5.2f1 - have there been significant improvements to Collab in later versions to warrant updating the project?
     
  9. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    400
    If you saved your scene and your scene file is not listed in the Collab Toolbar then it doesn't have any changes to push for that file. :)

    I'm so sorry that you ran into this issue right before a demo. :( We are still investigating this issue and appreciate every detail that you can offer on how to repro it. We have noticed that, in some cases, after getting into this state where Collab says it's synced but some changes are missing, forcing a merge conflict has been known to pull the missing changes. If you run into this problem again, would you mind giving that a try?
     
  10. batterj2-bb

    batterj2-bb

    Joined:
    Nov 5, 2013
    Posts:
    11
    With all due respect, forcing a merge conflict hardly sounds like a fix.

    This has got downright dangerous now - somehow we're all out of sync and pulling different versions from Collab so I've had to spend the past hour backing up yesterday's work, getting everyone to commit whatever it is they have, re-implementing all the changes and then committing. Yesterday I lost an hour's work, today I nearly lost a whole day...
     
  11. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    400
    That's completely fair. I know that this is really frustrating and I appreciate you being patient with me in troubleshooting this problem.

    I don't want the time that you spent making sure that your whole team has backed up/committed their latest changes to be a waste. I'd like you to try the following steps to help ensure that all team members' workstations are synced again:

    - Make sure that all workstations are using the same version of Unity
    - Make sure that you have no local changes in your project - if you do, back them up elsewhere and click "Restore" in the Collab history window
    - Delete everything under the $PROJECT_DIRECTORY/Library/Collab folder
    - Open your project in Unity, wait for it to import, then update

    Please let me know if following these steps helped.
     
  12. batterj2-bb

    batterj2-bb

    Joined:
    Nov 5, 2013
    Posts:
    11
    We're currently mid-sprint so we'll probably try this out at the end of the sprint (Friday).. should everyone in the team perform these steps?
     
  13. batterj2-bb

    batterj2-bb

    Joined:
    Nov 5, 2013
    Posts:
    11
    I've just found an older version of the project on my laptop. I opened it up and updated all the changes - several public variables were present but not set with their expected values, only their default ones (zero etc.)

    So I closed Unity and followed the instructions you provided and without even needing to update it had set all the variables correctly and the game works as expected.

    So what's going on here?