Search Unity

Unity Unity Playground Official Thread

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

  1. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    33


    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:
    13
    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:
    82
    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:
    8
    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

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    33
    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

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    33
    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

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    33
    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:
    82
    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:
    8
    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
     
    jeanpoolay likes this.
  10. cirocontinisio

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    33
    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?
     
    EvOne likes this.
  11. outpost31d

    outpost31d

    Joined:
    Feb 1, 2019
    Posts:
    8

    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!
     
  12. unity_gY8b0FM1siIhEA

    unity_gY8b0FM1siIhEA

    Joined:
    Apr 5, 2019
    Posts:
    1
    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:
    8
    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:
    35
    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. Sarhanbh

    Sarhanbh

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

    cirocontinisio

    Unity Technologies

    Joined:
    Jun 20, 2016
    Posts:
    33
    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:
    8
    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!
     
  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
  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.