Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Unity Playground Official Thread

Discussion in 'Community Learning & Teaching' started by cirocontinisio, Jan 9, 2019.

  1. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884


    Unity is proud and excited to release the very first project aimed at absolute beginners, teachers, educators and game designers wanting a more simplistic introduction to Unity.

    With custom inspectors, single-action components and a heap of great 2D assets you can get started straight away. You’ll find step by step documentation guidance included both in the project and online here on the Learn site.

    Download Unity Playground free here!

    Use this thread to ask questions and get help with playing, designing and understanding making games here.


    What is Unity Playground?

    A project designed in such a way so that Unity is presented in a more streamlined and effective manner. This 2D, physics based set up will help you understand the basic concept of game design and development as well as provide six example games for you to learn from, play and teach.


    Who is it for?

    We’re trying to provide Unity beginners and teachers a little more agency in the Editor hopefully allowing you to get more familiar with how Unity works. This brilliant project provides you with the tools you need to understand concepts, key terms and layouts while instilling the joy of game design in a fun and responsive way.


    Where can I start?

    Here!

    Download the project from the Asset Store and open up the Getting Started guide Unity’s Learn site. Follow the steps to start your game development journey! There is more in depth documentation in the Reference Guide, also on the learn site.
     
  2. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    16
    Great first start here, and something that had been a personal goal of mine to do. Unfortunately I'm not versed enough with custom editor design to execute on what I have in mind.

    I'd count myself as a refugee from Microsoft's aborted Project Spark game, which I still hold as the gold standard for Block/Tile based programming tools. Its Kode tile based language was linear execution from a Brain code container. Each Brain had Page(s) of (function) Tiles that were executed in order. The closets analogous structure in Unity that I can think of is that each Brain is equivalent to a single Component. Instead of building the whole program sequence out of Components as you've done, a single Brain would contain all the Kode tiles.

    Pages could be defined within Brains as a way of creating custom functions, built out of function Tiles. One of the most common types of Page setups was Input Mapping for both PC (Keyboard and Mouse) and Xbox (Controller). You'd define and map out all your Player actions (attack, block, jump, roll, etc) and bind them to Controller inputs, then duplicate the Page and make the binds for KB&M. From the Main (1st) page of the Brain, you'd then have a section of
    Code (CSharp):
    1. If Controller in Use -> Call Controller Binds Page
    2. If KB&M in Use -> Call KB&M Binds Page
    Like Components, a game object could have multiple Brains assigned to it. Both during editing, and dynamically during run-time. Things like Damage Over Time effects could be designed as a Template (Prefab) Brain, and assigned as needed. The DoT Brain would be responsible for Fire VFX, the Damage tick, and eventually its removal from the Game Object.

    Now all of the actual C# code behind the scenes was very complex to make it all just work, but to end users it was about as simple and intuitive as MITs Scratch. That simpleness wasn't a limiter either. Because of the Brains structure it was possible for Kode to grow and match the complexity that a user wanted to put it to. Up to making Arrays and Ordered Lists, which were not Variable options in Kode. Kode also allowed access to some rather deep parts of the Project Spark environment, access to physics aspects, ray casting, adjustments of the voxel terrain, and so forth. Oh, and it was a 3D focused environment, not 2D.
     
  3. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    Hi!
    What could be wrong?
    At first everything was fine, and I even created a simple game scene, but at some point the whole special interface disappeared and could not be called again using the menu or even after a complete reinstallation into a completely new project...

    P.S. Sorry for Googletranslate

     
  4. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    11
    This is amazing from a teachers perspective, I am just learning now and will deliver this to my students in the coming weeks. One question, the text in the text script says "you win!" but when i alter that text it does not change the text in game mode, for example when i collect all the stars with the space ship. Actually i think yheyext says player 1 wins. I can alter the font and colour but why does the text not change? thanks for any help
     
  5. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    You are the one who asked this question on Twitter too, right? In any case, I'll post my reply here too for others to read:

    In the script UIScript.cs, on line 112, you can just change that line to change the text. Right now it's:
    Code (CSharp):
    1. winLabel.text = "Player " + ++playerNumber + " wins!";
    but if you change it to:
    Code (CSharp):
    1. winLabel.text = "You win!";
    then it doesn't display the player number anymore.
     
  6. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    EvOne, I don't know exactly what's happening but I can see you're turning the Playground on/off from the top menu. If you don't see the custom Inspectors, try to go to Edit > Project Settings > Player Settings, then in the Other Settings block, go to Scripting Define Symbols*. If that line is empty, paste this:
    GAMEOBJECT_HEADER;DEFAULT_INSPECTORS;CUSTOM_INSPECTORS


    Once you press enter, the project should recompile and you should be able to see the Inspectors again.
    For reference, the procedure I described is nothing more than what happens (or should happen) when you click on Turn Playground On.
     
    EvOne likes this.
  7. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    This is all very interesting and thanks for the input. For the Playground I wanted to stay as close as possible to the current Unity paradigm, it's one of my priorities. This makes it easier to just get rid of it, and learn "vanilla Unity". In fact, the Playground IS vanilla Unity, it just has a few scripts pre-made for you but there are really no custom tools (like visual scripting or blocks) that hide the GameObjects/Components paradigm that everyone - including AAA studios - is using.
     
  8. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    I only get this error for a WebGL build, as soon as I switch to PC Standalone, - the On | Off switch starts working.

    Your way, with manual filling of "Scripting Define Symbols" - helps to turn on CustomInspector for WebGL, but then you can’t turn off the Playground from menu... :)


    P.S. This is simplest game prototype, created using Playground :)
    https://simmer.io/@Alex2D/~225ef94b-6919-ccf6-9c61-031204c38e41
    -With added switching between different input modes: Mouse/touch input, waypoynts and original WASD, teleports and spawn of targeting enemies :)
    (firebutton = <space>)
     
    Last edited: Feb 10, 2019
  9. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    11
    My students are building animations in the editor and linking them to the animator but looking to attach an animation to the spacecraft, what would they write into the movement script? thanks for any help
     
    irenabosworth and jeanpoolay like this.
  10. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Tried it, it's very cool!

    Connecting animation (as in the Animator / Animation Clips) is currently not supported in the Playground for now. However, I might be looking into adding it. What kind of animation are you thinking of? A flipbook animation?
    A walking cycle that starts when you move and stops when you stop?
     
    irenabosworth and EvOne like this.
  11. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    11

    I was thinking just to start the rockets fireing when you move your spaceship. We can create the animation with the animator but a drag and drop script to play that animation ( or any animation) when the wsad keys are clicked would be awesome!
     
    irenabosworth likes this.
  12. ASWilburn

    ASWilburn

    Joined:
    Apr 5, 2019
    Posts:
    4
    Hi, I'm having a couple of issues with the Playground:

    #1: I'm having an issue with the Object Creator Area script. I'm trying to make multiple enemies spawn from one spawner. I have one object spawning at 1 second, another at 10 seconds, and one at 20 seconds. However, when the game first starts all of the objects spawn at once and then it kicks my settings in, with the second and third objects showing up again at 10 and 20 seconds respectively.

    The best solution I found to this was, depending on how your game plays, was to create individual spawners for each enemy and space them out with the x-coordinate position at different intervals to stop them from all popping up at once. The downside to this is it is a little more resource heavy because depending on the game you're making and how many enemy types you have you couldn't potentially have dozens of enemies coming at you off screen. But if you're making strictly 2D games with modern technology this shouldn't be too big of an issue.

    Here's a simple table to help with your delayed enemies:

    X=2.5 is roughly 1 second of gameplay
    x=25 is 10 seconds
    x=50 is 20
    x=75 is 30
    x=150 is 60
    x=225 is 90

    #2 Is there a way to make it so my enemies don't keep crashing into each other using strictly playground? Right now I have different enemies coming at my player and will collide with each, causing them to fly off in different directions and then unnecessarily hitting the player, making it feel cheap when the player loses. I also have some artwork that I would like the player of the game to see but it keeps getting knocked out of the camera view by other objects.

    Any help would be greatly appreciated. Thank you.
     
  13. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    11
    No responses to questions here in a month and a half. Too bad this playground project could really move forward with just a little support for questions in this forum :(
     
    jeanpoolay and EvOne like this.
  14. iflei

    iflei

    Joined:
    Apr 18, 2019
    Posts:
    1
    Hi, I have a question , my game's idea is let the enmeies chasing the player, but the enemies are crashing down to each other , and do not following the player( I use the flowing the target script), ? I think this is a common idea, but the enmenies crash down to each other , please tell me how to solve the problem\
     
  15. forensicsman

    forensicsman

    Joined:
    Jun 17, 2014
    Posts:
    36
    I just found out about this. As I was reading through the documentation I did not see any Drag&Drop scripts. I think it would be a great addition to add those into play ground.
     
  16. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    is playground template work for mobile touch input? or will be in next update? thanks
     
  17. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Sorry for the late replies, everyone.

    Yes, the Object Creator Area script doesn't support delay. However, you can quickly change this by using a combination of Condition Repeat (which has both delay and repetition) and connect a Create Object Action.

    Otherwise, if you know are a teacher and know scripting, you can quickly add a delay to the Object Creator Area and distribute this custom version to your students.


    This is functionality included in normal Unity. First, assign your class of enemies to a different Layer. Then, go to Edit > Preferences > 2D Physics, and make sure the Enemy layer doesn't collide with itself in the Layer Collision Matrix:

    Screenshot 2019-06-16 at 18.11.42.png

    See my reply above.

    What do you mean by "drag and drop" scripts? Playground doesn't support clicks/mouse.

    No, touch input would require a whole set of new scripts. For now, I prefer to keep it simple and just focus on keyboard input. As with mouse, all of these alternate input methods would require a complete rework of many scripts, something I can't manage at this time.
     
  18. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    11
    My students are loving this, one thing they are requesting a lot is the movement script linked to an animation. For example when the rocket moves they could play a thrust animation. Currently we have the thrust as just particles. We do create animations but have no way to activate them. thnx for any help!
     
    irenabosworth likes this.
  19. kippesp

    kippesp

    Joined:
    Oct 22, 2016
    Posts:
    1
    Today our company hosted a kids to work event day. Since we're a technology firm, we have various workshops in the STEM area. This year, a coworker and I put together a Unity+Playground platformer game that was well received by the students and parents. Our expectations didn't quite fit in 90 minutes, but I think two 60 minute sessions could easily complete everything we had planned. We were pleased with how the Playground scripts could be used with a 2D platformer game (although we did make customizations when needed).

    For anyone interested, our project and slide/class URL are available in our project's github site: https://github.com/kippesp/unity_2d_mar_e_o
     
    Last edited: Jun 19, 2019
    iamchathu likes this.
  20. dmirliss

    dmirliss

    Joined:
    Feb 26, 2019
    Posts:
    2
    Hi - I am not able to turn on Playground mode and looked at the project settings that you indicated above. I see that the project settings are correct. Is there something else I am going incorrectly? I am running Unity 2019.2.2f1.
     
  21. IngridGalaxos

    IngridGalaxos

    Joined:
    Jan 25, 2014
    Posts:
    10
    Thanks for sharing this tutorial. It is very nice for beginners.
    When I did the part of the Laser shooting the asteroids I noticed that my score in the UI was reset to 0 when I destroyed an asteroid. And looking closely into the tutorial, I saw it happen there, as well (13:02-13:03 of the video).
    It took me a while, but I found out the cause:
    In the singleplayer mode, the score of destroying the asteroids (which is set to 0) will be attributed to the wrong player, and the score of the wrong player will be shown in the UI.
    This is caused by the LaserShooter. This is a childobject of the ship. The ship has the tag 'Player', but the LaserShooter doesn't.
    The Start method of the ObjectShooter script values the playerNumber variable based on the tag (but the LaserShooter does not have a tag):
    playerNumber = (gameObject.CompareTag("Player")) ? 0 : 1;
    That's why the playerNumber becomes 1 instead of 0.

    The collections script gives the score to the correct Player, so you still win the game, but the UI is a bit confusing.

    I can solve this by giving the LaserShooter also the tag Player (but this might cause problems furtheron) OR by changing the line in the script to:
    playerNumber = (transform.parent.gameObject.CompareTag("Player")) ? 0 : 1; (this requires that the ObjectShooter script is always a Component of a child of the player and not of the player object itself; I think it is good practice to do so; but will this always be the case?).
    Is there another option to solve this problem? (I myself think that both solutions are not as robust as I would like them to be).
     
  22. dmirliss

    dmirliss

    Joined:
    Feb 26, 2019
    Posts:
    2
    Hi Everyone,
    I have been using playground with my middle school class for about a month. One problem that we have been experiencing is that it takes a long time for the Playground mode to turn on. The students are all using their own laptops (it's a BYOD school). Most of the students have MACs but I am also having trouble switching between modes on my PC.

    The second issue is that the "field of view" does not work in Playground. We are up to the part in the tutorial in which you can change the field of view for the camera but it does not seem to be working for anyone (even me) in when playground is turned on.

    Any help with either of these 2 issues would be appreciated.

    Thank you!!
     
  23. deliotYLHS

    deliotYLHS

    Joined:
    Jul 7, 2019
    Posts:
    1
    I just wanted to send out a hearty THANK YOU to those that created Playground. This is my first time teaching Unity (though I have lots of experience teaching Java, C, C++, PHP, MIT App Inventor, PhoneGap, etc.). I was pretty nervous going into this brand new class at our school.

    The High School students have really warmed to Playground, and it's been a great way to start off the year. We've completed extended versions of the Lander game, a multi-scene Maze game, and we are starting "Defender" this week. We will finish Playground with a 2D side-scroller sort of "Mario" clone. Playground has really built the confidence of me as their teacher, and the students as a whole.

    In a few weeks, we will be moving on to the Create With Code curriculum, and hope to get our students to pass the "Unity Certified User" exam. I really think that Playground has played an invaluable part in getting all of us comfortable with the Unity interface, assets, heirarchy, and inspector before we get into the more demanding C# scripting stuff.

    So thanks again! I'm really pleased with the high quality of games we were able to create with Playground from day one.
     
  24. iamchathu

    iamchathu

    Joined:
    Oct 23, 2013
    Posts:
    8
    Any plans to add restart game option?
     
  25. spoonyfish

    spoonyfish

    Joined:
    Feb 12, 2017
    Posts:
    1
    I was going through this Live Training 17th October 2016 - 2D Games for Non-Programmers video with my kids as a great introduction to unity unsing the playground. We were having a great time until we found some of the scripts had changed.
    The problem occurred when the tutorial used the AutoMoveTowardsPlayer script which no longer exists. We then used the FollowTarget script instead which worked as a single game object. Once we tried to use as a prefab however it would not allow a reference to an in scene player object.

    How did the original script avoid this problem?
     
    EvOne likes this.
  26. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Late answer, but I wanted to provide an idea since I know that this is a common issue.
    Unfortunately there is no way to bind a property of a Prefab to a scene element, because from the Prefab's point of view, he doesn't even know the scene exists! :)
    Normally you would resolve this somehow with some specific code, but that's not the objective of the Playground.

    So as a "hack", you could do this: instead of using the real Prefab, from the assets, you could just put a copy of the Prefab in the scene and make modifications there, and use that as the master copy that your scripts spawn. Like for instance, a shooter script that spawns a bullet.

    To avoid this object from being destroyed, I've seen the most creative solutions… a bullet "hidden" far away from the centre of the scene, or if it's an enemy chasing the player, you can do the same and fence it inside 4 walls :) So the enemy "prefab" is there ready to use and heads for the player, but can never reach it.
    Then you can duplicate it several times and you have your hack :)
     
  27. Pich83

    Pich83

    Joined:
    Apr 29, 2020
    Posts:
    1
    Is there a way to custom the Fonts in the Dialogue Balloon action? I See we can change the fonts in the UI prefab for all those health & score label, so I guess we can change the font for the dialogue as well.
     
  28. yazoozay

    yazoozay

    Joined:
    Jun 9, 2020
    Posts:
    10
    Hello! I am new to Unity and I started with Playground to help my kids fulfill some of their dreams. I have no knowledge of programming tho.
    We have huge progress in just a month or two and we start to see the disadvantages of Playground.
    However, I was wondering if there is a way to make custom scripts and implement them in Playground? Like Replay and Play buttons for example. To make the simple games a bit versatile.
    I have found some custom scripts for Playground for Move with animation for example, but still have no idea how to make it work. But if someone has managed to make such a custom script, there should be a way to make buttons as well, right? :)

    Any help or ideas?

    Thank you in advance :)
     
  29. yazoozay

    yazoozay

    Joined:
    Jun 9, 2020
    Posts:
    10
    Another Question here. The Prefab slot from the Load Level script disappeared. And now I can't add new scenes. It worked at the beginning, then I started adding more levels and suddenly, the option disappeared from all scenes and I can't seem to bring it back. Making a new object and adding a new Condition Collision with Load level script, doesn't work too. Any suggestions on how I can resolve that problem?
     

    Attached Files:

  30. yazoozay

    yazoozay

    Joined:
    Jun 9, 2020
    Posts:
    10
    Cmon boys! Is the Playground threat so deserted as it seems?
     
  31. yazoozay

    yazoozay

    Joined:
    Jun 9, 2020
    Posts:
    10
    All right! It's me again. If anyone sees this, can you please tell me if a game made in Playground can be exported to the web via WebGL or any other alternative because it's not working for me when I try to? Thanks!
     
  32. jsills2

    jsills2

    Joined:
    Oct 5, 2022
    Posts:
    1
    Hello!

    I am using Unity Playground with students and we are trying to use the PICK-UP AND HOLD script, but we don't think it is working properly. We have everything mentioned in reference guide on the object, but it doesn't pick up the object. When the is trigger is marked the player will just go through the object. When the is trigger is marked off, the player will collide with the object and it moves. Clicking the button to pick up the object just causes the object to float through colliders but game object doesn't follow the character. I am guessing something is wrong with the parent-child part of the script but unsure as there are no errors. Here is the script down below.
     

    Attached Files: