Search Unity

Bug Can't find Unity.Servies

Discussion in 'Unity Gaming Services General Discussion' started by moproductions, Dec 24, 2022.

  1. moproductions

    moproductions

    Joined:
    Sep 28, 2010
    Posts:
    88
    So I've followed the instructions on the Getting Started with UGS page where I created the project, linked it to the services via the Project Settings, etc. However, when I tried to create my own version of the "InitializationExample" script, I can't even seem to import Unity.Services at all let alone get started. I put this at the top:
    using Unity.Services.Core;

    But it gives me the red squiggly underneath. I've downloaded the Case samples project where it's recognized but I can't tell the difference as far as what I have to do to get access to Unity Services in my own project.
    I know this is basic but it's weird that I can't get it going.
    Thanks!
    -Mo
     
  2. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    282
    Hi Mo,
    Thanks for posting on the forums.
    What service are you trying to integrate?

    All services need a package in order to be integrated and have the Unity.Service.Core is part of all packages.
    You can add a package by going to the Editor > Window > Package Manager > Search for the package
    upload_2022-12-26_9-11-44.png

    Hope this helps you out.
    Happy Holidays.
    Seb
     
  3. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    Thank you for letting us know, @moproductions. We'll make an update to the Getting Started documentation to clarify package installation.
     
    SebT_Unity likes this.
  4. kaymo

    kaymo

    Joined:
    Dec 23, 2020
    Posts:
    3
    Package installation is not clarified yet. My unity registry does not contain Unity.Service.Core and I cannot add it by name.
    How to proceed to install Unity.Service.Core?
    my version: 2021.3.1f1
     
  5. kaymo

    kaymo

    Joined:
    Dec 23, 2020
    Posts:
    3
    need to add: using System;
    in initialization script
     
  6. richj_unity

    richj_unity

    Unity Technologies

    Joined:
    Sep 23, 2019
    Posts:
    40
    You shouldn't need to install Unity.Services.Core by itself - it is a dependency of all UGS packages, so it should install automatically when you install RemoteConfig, CloudCode, etc. I'll see if we can clarify this in the Getting Started doc.

    That's a good callout for adding "using System;" to the code snippet in the docs. Thank you!