Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Official 2D Game Kit Official Thread

Discussion in 'Community Learning & Teaching' started by Aurore, Feb 12, 2018.

  1. joaoluizsn5

    joaoluizsn5

    Joined:
    Jul 15, 2022
    Posts:
    3
    I can't find the "HubDoor". It only appears in the Art>Sprites>Interactables as "HubDoor0" 1, 2 and 3. But I can't find the one I can work on. Also, can I use keys from different scenes to open the HubDoor?
     
  2. jellybunnybean05

    jellybunnybean05

    Joined:
    Jan 27, 2022
    Posts:
    22
    Deleting the RuleTile script seems to be working for me as well, thank you!
     
  3. Iszards

    Iszards

    Joined:
    Aug 14, 2022
    Posts:
    1
    Is there no official resolution for the "
    Assets/2DGamekit/Utilities/Editor/RuleTileEditor.cs(13,23): error CS0433: The type 'RuleTile' exists in both 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Unity.2D.Tilemap.Extras, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    " issue?

    Just deleting the RuleTileEditor.cs file without knowing it's intended purpose. Seems shady. No one is reporting it breaking anything. What is the point then in including it? I'd rather understand an error and its resolution steps. Can we get an official update or resolution?
     
  4. GG_UUnity

    GG_UUnity

    Joined:
    Sep 1, 2022
    Posts:
    1
    After importing, there is no kit tool menu, and new scenes cannot be created, so the first step cannot be carried out.
     
  5. MagendanzC

    MagendanzC

    Joined:
    Jun 11, 2021
    Posts:
    3
    Here's my aggregate list of fixes for the 2D Game Kit with Unity 2021 LTS that I put together for my students:

    To create a new 2D Game Kit project, use the 2D Core template and then import the 2D Game Kit package from the Asset Store using Package Manager.

    ISSUE: You immediately receive several console errors that prevent the sample scenes from running.
    WORKAROUND: Delete the script file named RuleTileEditor.cs. This has been moved to the 2D Tilemap Extras package, so it’s a redundant copy.

    ISSUE: You’ll receive a warning that “The version of Burst used by your project has changed. Please restart the Editor to continue.”
    WORKAROUND: After the import is successful and previous fix is applied, quit and restart the Unity Editor. When you restart, you’ll be prompted to chose another Editor version, so pick the latest 2021 LTS release you have installed. You’ll get another scary warning that you’re “Opening Project in Non-Matching Editor Installation,” but just hit Continue.
    At this point, the Kit Tools menu should be visible and you should be able to run the sample game.

    ISSUE: Several prefabs (e.g. Teleporter, Spikes) with custom shaders appear in magenta.
    WORKAROUND: Select the affected prefab and pick the Universal Render Pipeline/2D/Sprite-Lit-Default shader in the Inspector. The thumbnail in the Project panel won’t update immediately, but it should look right when you drag it to the Scene panel.

    ISSUE: Ellen takes damage, but the HealthCanvas isn’t updated.
    WORKAROUND: On Ellen’s Damageable, the On Health Set event is trying to call a missing HealthUI.SetInitialHeartCount function on HealthCanvas. Instead, select HealthUI.ChangeHitPointUI.

    If you want to implement a weapons pickup, you’ll need to create a prefab from the WeaponPickup game object in Zone 3. Just drag it from the Hierarchy to the Prefabs/Interactables folder in the Project panel and then drag it from there into your new scene. You’ll also need to disable the “Melee attack enabled” and “Range attack enabled” checkboxes in Ellen’s Player Input component.

    If you want to implement a boss level, you’ll need to create prefabs for the Gunner and BossCanvas game objects in Zone 5. Make sure to enable them first, then drag them to the Prefabs/Enemies and Prefabs/UIPrefabs folders, respectively, and then from there to your new scene. In the Missile Golem script in Gunner/GunnerMaster, you’ll need to drag Ellen to Target and BossCanvas/BossHealth to Health Slider, and BossCanvas/BossShield to Shield Slider. You’ll also need to create an empty game object with a Background Music Player component, then set Music Audio Clip to MusicGameplay, Music Output to Music and Ambient Output to Ambient.

    ISSUE: Gunner will take shield damage, but not hits from range or melee attack.
    WORKAROUND: Gunner/GunnerMaster/DamageZone is set to the BossWeakPoint layer, which isn’t on the Damager hit layers for Ellen or her bullets. The simplest fix is to set this game object to the Enemy layer.

    ISSUE: Gunner will only play first round, and take no damage after that.
    WORKAROUND: Rounds 2 and 3 in the Missile Golem component reference Platforms that will be missing in your new scene. You can recreate these or simply set their count to zero.
    When you defeat the boss, students will likely want to do a scene transition to indicate the game is finished. Do this by dragging a TransitionStart prefab into your scene, set Transition When to External and Transition Type to Different Zone. Then select either Start or Loading in the New Scene Name dropdown. Then in Missile Golem under On Defeated, add an event to call SceneController.TransitionToScene() on the SceneController object. As the parameter, pass in your new TransitionStart object.

    Since my students don’t have privileges to run new Windows executables on the lab machines, I prefer to have them publish their games using WebGL.

    ISSUE: Typical games based on 2D Game Kit will be less than the WebGL size limit, but they’ll consume more than the default PlayerSettings.WebGL.memorySize. You’ll also need to disable Auto Graphics API in Player Settings and remove WebGL 1 to clear color space errors.
    WORKAROUND: Unfortunately, since the WebGL.memorySize setting is no longer shown in Player Settings, you have to set this via other means. My solution was to create a preset and hand edit the webGLMemorySize propertyPath to the value 512. Students then download the preset, import it as an asset and then apply it in Player Settings.

    The WebGL Publisher package isn’t included like it is for the microgames, but at this point you can install it from the Unity Registry using Package Manager and follow the same WebGL publishing process.
     
    Last edited: Oct 9, 2022
    Bubblegum_Tits likes this.
  6. seinita-games

    seinita-games

    Joined:
    Nov 19, 2021
    Posts:
    7
    I don't know how to control the game on a Mobile device. After installation, I can't control it for example make it move forward or backward, jump, shoot, and fight. Please help kindly help me. Also, how to make scoring?
     
  7. seinita-games

    seinita-games

    Joined:
    Nov 19, 2021
    Posts:
    7
    Dear Sir/Madam,

    After I built it for android mobile, it is not working on player control. Could anyone guide me on how to control the player and make it works? Thanks for your kindness in advance.
     
  8. sauloraul

    sauloraul

    Joined:
    Oct 14, 2022
    Posts:
    1
    I am trying to export the game to Web GL and I keep getting this error when I click Build and Run:

    Code (CSharp):
    1.  
    2. Shader error in 'Water2D': invalid subscript 'grabPos' at line 56 (on gles)
    3. Compiling Subshader: 0, Pass: , Vertex program with <no keywords>
    4. Platform defines: SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
    5. Disabled keywords: SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING
    6.  
    How do I fix it so it imports the WebGL?

    Thanks in advance for your help