Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Adventure Game Q&A

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Dec 21, 2016.

  1. DrGonzosGame

    DrGonzosGame

    Joined:
    May 1, 2017
    Posts:
    12
    In case anyone actually reads stuff in here - dropping the players Turn Smoothing value from 15 down to around 7 seemed to have fixed the issue.
     
    Malkalypse likes this.
  2. HristoMalakov

    HristoMalakov

    Joined:
    Aug 3, 2017
    Posts:
    15
    Greetings,

    In phase 1b, at minute 45, when I have to test my character movement, I cannot move at all. No rotation, no animation, nothing. I tried looking for answers to the most common problems, but nothing helped. I downloaded the completed version of the asset store and copy-pasted the code from the ready PlayerMovement into mine, but it didn't help either. I followed the video to the dot, I checked my parameters twice, but I never found the problem. Would you please help me with that?

    EDIT: I get the error

    There are no audio listeners in the scene. Please ensure there is always one audio listener in the scene
    0x00000001409897FB (Unity) StackWalker::GetCurrentCallstack
    0x000000014098CD5F (Unity) StackWalker::ShowCallstack
    0x0000000140D35030 (Unity) GetStacktrace
    0x0000000141079D56 (Unity) DebugStringToFile
    0x000000014107A52C (Unity) DebugStringToFile
    0x0000000140B9A7DC (Unity) AudioManager::ListenerCheck

    I dont know why, I remember I did the step where they set an Audio Listener and the lecturer explains why it's important to have one.


    Thank you in advance.

    EDIT: My mistake was that I imported all assets into the same project. Fixed it. No need for help.

    This is my code:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.EventSystems;
    5. using UnityEngine.AI;
    6.  
    7. public class PlayerMovement : MonoBehaviour
    8. {
    9.  
    10.     public Animator animator;
    11.     public NavMeshAgent agent;
    12.     public float inputHoldDelay = 0.5f;
    13.     public float turnSpeedThreshold = 0.5f;
    14.     public float speedDampTime = 0.1f;
    15.     public float slowingSpeed = 0.175f;
    16.     public float turnSmoothing = 15f;
    17.  
    18.     private WaitForSeconds inputHoldWait;
    19.     private Vector3 destinationPosition;
    20.  
    21.     private const float stopDistanceProportion = 0.1f;
    22.     private const float navMeshSampleDistance = 4f;
    23.  
    24.     private readonly int hashSpeedPara = Animator.StringToHash("Speed");//?
    25.  
    26.     private void Start()
    27.     {
    28.         agent.updateRotation = false;// stops player when they are down for item
    29.  
    30.         //pause in between interactions
    31.         inputHoldWait = new WaitForSeconds(inputHoldDelay);
    32.  
    33.         //sets the starting position of the char
    34.         destinationPosition = transform.position;
    35.     }
    36.  
    37.     //moves the char
    38.     private void OnAnimatorMove()
    39.     {
    40.         agent.velocity = animator.deltaPosition / Time.deltaTime;
    41.  
    42.     }
    43.  
    44.     private void Update()
    45.     {
    46.         if (agent.pathPending)
    47.         {
    48.             return;
    49.         }
    50.  
    51.         float speed = agent.desiredVelocity.magnitude;
    52.  
    53.         if (agent.remainingDistance <= agent.stoppingDistance * stopDistanceProportion)
    54.         {
    55.             Stopping(out speed);
    56.         }
    57.  
    58.         else if (agent.remainingDistance <= agent.stoppingDistance)
    59.         {
    60.             Slowing(out speed, agent.remainingDistance);
    61.         }
    62.  
    63.         else if (speed > turnSpeedThreshold)
    64.         {
    65.             Moving();
    66.         }
    67.  
    68.         animator.SetFloat(hashSpeedPara, speed, speedDampTime, Time.deltaTime);
    69.     }
    70.  
    71.     private void Stopping(out float speed)//becauyse we are affecting the speed outside of the function
    72.     {
    73.         agent.isStopped = true;// original code: agent.Stop()
    74.         transform.position = destinationPosition;
    75.         speed = 0f;
    76.     }
    77.  
    78.     private void Slowing(out float speed, float distanceToDestination)
    79.     {
    80.         agent.isStopped = true;//
    81.         transform.position = Vector3.MoveTowards(transform.position, destinationPosition, slowingSpeed * Time.deltaTime);
    82.         float proportionalDistance = 1f - distanceToDestination / agent.stoppingDistance;
    83.         speed = Mathf.Lerp(slowingSpeed, 0, proportionalDistance);
    84.  
    85.     }
    86.  
    87.     //just sets the rotation
    88.     private void Moving()
    89.     {
    90.         transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, turnSmoothing * Time.deltaTime);
    91.     }
    92.  
    93.     public void OnGroundClick(BaseEventData data)
    94.     {
    95.         PointerEventData pData = (PointerEventData)data;
    96.         NavMeshHit hit;
    97.  
    98.         //if we hit something, move there
    99.         if (NavMesh.SamplePosition
    100.             (pData.pointerCurrentRaycast.worldPosition, out hit, navMeshSampleDistance, NavMesh.AllAreas))
    101.         {
    102.             destinationPosition = hit.position;
    103.         }
    104.         //else find something nearby
    105.         else
    106.         {
    107.             destinationPosition = pData.pointerCurrentRaycast.worldPosition;
    108.         }
    109.         // and set us there
    110.         agent.SetDestination(destinationPosition);
    111.         agent.isStopped = false;
    112.     }
    113.  
    114. }
    115.  
     
    Last edited: Aug 14, 2017
  3. TheLapisFox

    TheLapisFox

    Joined:
    Feb 14, 2017
    Posts:
    3
    Noticed a few issues here.

    1. In all of the packages for this tutorial, agent.Stop() and agent.Resume() should be changed to agent.IsStopped = true/false (respectively) within the PlayerMovement.cs script;
    2. This one is the most damaging issue, the download for 5/6 is missing the Editor script InterableEditor.cs completely.

    While #1 is not a game stopper as Unity will still allow the Stop and Resume methods (at least until they are removed anyways), it is completely impossible to continue past 10:54 in the video without that script. Might want to have someone take a look and fix that package.
     
  4. Ins_Py

    Ins_Py

    Joined:
    Aug 21, 2017
    Posts:
    5
  5. Ins_Py

    Ins_Py

    Joined:
    Aug 21, 2017
    Posts:
    5
    Anyone ?
    I'm always stuck ...
     
  6. drhmiri

    drhmiri

    Joined:
    Jun 17, 2014
    Posts:
    72
    I imported the complete game, which should presumably work without modifications. Right?

    However, as I followed along the first two phases (The Player & The Player Continued) I realized there were a couple of tiny things that still needed to be done, though now when I run the game, I get the following three error messages, the first two referring to a missing SceneController, and the third one highlights the Player game object in the Hierarchy.

    UnityException: Scene Controller could not be found! Ensure that it exists in the Persistent scene.
    Saver.Awake () (at Assets/Scripts/MonoBehaviours/DataPersistence/Saver.cs

    NullReferenceException: Object reference not set to an instance of an object
    Saver.OnDisable () (at Assets/Scripts/MonoBehaviours/DataPersistence/Saver.cs

    NullReferenceException: Object reference not set to an instance of an object
    PlayerMovement.Start () (at Assets/Scripts/MonoBehaviours/Player/PlayerMovement.cs

    There is a SceneController.cs script in the project. Where should I add that? Also, does anyone know what exactly it is that is null in the Player that I get the third error?
     
  7. NA_

    NA_

    Joined:
    Aug 20, 2017
    Posts:
    4
    @drhmiri : I had similar problems once. You shouldn't start with the complete project when you want to follow the steps presented in the videos. The complete project contains parts that are not there yet in the first phases (e.g. persistent scene). This means things are set up a bit differently in the videos.

    If you want to follow the steps, download the asset package for the specific phase and start with that.
     
    drhmiri likes this.
  8. NA_

    NA_

    Joined:
    Aug 20, 2017
    Posts:
    4
    I have a general question about the interactable system that is presented in this tutorial. I'm using it a bit differently for a FPS game and its basically working fine (I adapted the way events are triggered).

    However, I noticed that it is not possible to save complete interactables (including condition collections and reaction collections) as prefabs. This is not working in the Adventure tutorial either ! You can try out with any complete intereactable (e.g. GuardInteractable, make a prefab of it). There are errors because the conditionCollections and reactionCollections contain null objects. They turn to null objects when I make the prefab.

    This is a problem to me. It has to be possible to save the complex interactables that I set up, so that I easily recreate them if something goes wrong.

    Why is this not working? Is it possible to adjust the interactable system to get this working?

    (really hoping that someone still looks into this thread... )
     
  9. twilightZone

    twilightZone

    Joined:
    Oct 10, 2014
    Posts:
    28
    Hello all,
    Thanks a lot for this tutorial which is very interesting.
    I do not have any problem, but I have a question, for the video "phase 2 of 6 - the inventory" at 45:00 we have to grab, from the hierarchy panel, the four itemImage on the inventory script in the window inspector to populate item slot 0, element 0 to item slot 3 element 3. It works well. but If I have, for example an inventory with 40 boxes, I have to repeat the operation 40 times, it is not very easy.
    If I give a different name for each different ItemImage, for example ItemImage0 --> ItemImage3, is it possible to create a script that automatically, at startup, link the ItemImage in the inventory script ?
    Thanks a lot
     
    Last edited: Sep 26, 2017
  10. Leink

    Leink

    Joined:
    Oct 3, 2017
    Posts:
    1
    Hello Someone can help me I'm in phase 1b of the adventure tutorial I have a problem that when I click to make my character progress simply does not, does not move from the site, someone has this happened?, Use Unity 2017 .1.0p5
     
  11. Monsoonexe

    Monsoonexe

    Joined:
    Jan 18, 2017
    Posts:
    1
    I am experiencing this same issue. It doesn't look like it's an issue with my code, as it all appears to match. I'm scrutinizing the animator next to debug this issue.
     
  12. Ettrig

    Ettrig

    Joined:
    Sep 15, 2017
    Posts:
    5
    How do we create a Mesh that can be dragged into the Mesh Collider.

    In part 1a, at 19 minutes, a NavMesh is made (Baked).

    Later, at 27:20 minutes, a Mesh Collider component is placed on object SecurityRoom in scene SecurityRoom.

    A Mesh (SecurityRoomMeshCollider) is dragged into a field in this component. The tutorial does not show how such meshes are generated.

    It is very easy (at least for me) to get the impression that the baking at 19 minutes creates the mesh used with the Mesh Collider at about 28 minutes. But it is not. The mesh that is used at 28 minutes exists in the imported (base) material, in Assets/Models/SecurityRoomCollision.

    Creating such a Mesh is a necessary step when using the knowledge from this tutorial to build similar but different games.
     
    Last edited: Oct 28, 2017
  13. Ettrig

    Ettrig

    Joined:
    Sep 15, 2017
    Posts:
    5
    One way to handle this problem is to copy the code from the finished project. I know the finished project runs OK in 2017.1. If you are intent on finding the bug, you can make different mixes of your own code and the functioning code from Unity. Exchanging first half of the code, then a quarter, then an eightth, a surprisingly small number of test rounds will zoom in on the error. Maybe this advice is too obvious. But the question here seems to show that it is needed. Good luck!
     
  14. kubajs

    kubajs

    Joined:
    Apr 18, 2015
    Posts:
    45
    Hi guys, first of all thanks for this great tutorial! I really appreciate you presented us with the interactables, interaction and all the related pro production project mature techniques and stuff.

    One question:
    In PlayerMovement script in OnGroundClickMethod:
    I don't understand under what circumstances the else clause can be hit (I was unable to simulate such a case in my project):
    Code (CSharp):
    1.  else
    2.             _destinationPosition = pData.pointerCurrentRaycast.worldPosition;
    My understanding is the OnGroundClick is hit only in case user clicks on the NavMesh. So in this case I believe we should also have the NaMeshHit set (as we already hit the navmesh so we should have the hit position as well). Why do we need the else condition and if it is really needed, could you please explain me what I need to do to get to the "else" clause?

    Thanks a lot,
    Kubajs
     
  15. Ettrig

    Ettrig

    Joined:
    Sep 15, 2017
    Posts:
    5
     
  16. Ettrig

    Ettrig

    Joined:
    Sep 15, 2017
    Posts:
    5
    This relates to my question above. I had the same incorrect understanding of how it works. In my view, the tutorial is misleading on this aspect. The OnGroundClick event is NOT (formally) related to the NavMesh. The event that triggers OnGroundClick is related to a Mesh that is referenced by the Mesh Collider. Mesh and NavMesh are different data types. but I suspect that the Mesh is a kind of translation of the NavMesh. I would like to learn how to make such a translation. See my question above.

    To see this, go to scene SecurityRoom and look at the object SecurityRoom in the Inspector. It has a component Event Trigger that calls the OnGroundClick function (method). I strongly suspect that the Event Trigger is triggered by the component Mesh Collider on the the same object (SecurityRoom). I think the Unity documentation for Event Trigger should specify how it is activated. But it doesn't, as far as I can see. If you click on the field Mesh in component Mesh Collider (in Inspector) it will highlight the referenced Mesh.

    You can test this explanation by extending the NavMesh. For example, in scene SecurityRoom you can remove the coffeetable, magazines and chairs, and rebake the NavMesh in the Navigation window. The changes in the NavMesh can now be seen in the Navigation window. But you cannot walk to the new NavMesh area. This is because there is no collider there, so the click will not be registered.

    That is as far as I got in my investigations. But actually it does not answer your question. I think that for your objective, you need to do the opposite: Add some objects so that the NavMesh becomes smaller. (Remember to make the objects Static.) Clicking near such a new object should get you to the else clause. I would be interested in your findings.
     
  17. kubajs

    kubajs

    Joined:
    Apr 18, 2015
    Posts:
    45
    Thanks Ettrig! You were right. I was finally able to reproduce it.
    How to reproduce it in the demo scene:
    1. set navMeshSampleDistance to 0.1f (variable in PlayerMovement script)
    2. click to the navMeshCollider area but outside NavMesh (e.g. on the rightmost chair).
    I couldn't get to the else clause before since navMeshSampleDistance was originally set to 4f so the tolerance was 4 meters. Looks like the navMeshCollider haven't overlapped the navMesh so much.

    So yes, exactly: OnGroundClick is called whenever user clicks to the navMeshCollider.
    but NavMesh area can be smaller than the navMeshCollider, therefore we need the else check.
    MaxDistance parameter in NavMesh.SamplePosition sets the tolerance radius how far the clicked position can be outside the NavMesh border.
     
    Last edited: Oct 31, 2017
  18. descenderz

    descenderz

    Joined:
    Nov 9, 2017
    Posts:
    1
    I have updated to the new version a few days ago and beginning this project. It does not recognize the namespace provided by the speaker or the text that shows during the same time. I went ahead and completed it but the click to move script does not seem to register. Any suggestions? I'm not sure if the namespace is causing the problem or not.
     
  19. jf3ng

    jf3ng

    Joined:
    Nov 11, 2017
    Posts:
    1
    I'm also using Unity 2017.1.0f3, and am getting these errors. Has anyone figured out why the LostItemReaction.cs, etc files aren't finding the Inventory namespace?
     
  20. Ettrig

    Ettrig

    Joined:
    Sep 15, 2017
    Posts:
    5
    I use 2017.1.1. A suggested work-around is to copy the script from the final project.
     
  21. dylanfachoso

    dylanfachoso

    Joined:
    May 31, 2017
    Posts:
    1
    ¡Hi! i got some issues with the animator ( i suppose). When i'm playing i have a long wait between the idle state and moving state. I have to wait to the animator to finish the Idle animation to move arround, if i stop i cannot pass to the moving state without waiting the animation complete. Anyone know how can i fix this?
     
  22. TomHillsten

    TomHillsten

    Joined:
    Sep 17, 2017
    Posts:
    1
    1. I am using Unity 2017.2.0f3. I am having a lot of confusion on what scene should be open, when I download the corresponding download. Example Video 5 of 6, Interactables. The video starts with an empty scene named "Untitled" with a long listed of folders for the project. So do I open a new scene and then download part 5 from the asset store?

    The videos do not, in my opinion, setup the start of each video well. I was not there for the live show, Unity title for the top just states, TrainingDayPhase5,,,

    2. I too did not/still don't know how/why to have 2 scenes open at the same time.

    3. In MonoDevelop, when I try to print a script, it prints small parts of the script on each page over like 10 pages. How can I print the whole script on 1 or 2 pages as needed?

    4. Is it possible to 'color' parts of a script, to visually breakdown the script into parts to read it easier?

    Thank you for any help you can provide.
     
    Last edited: Nov 26, 2017
  23. tam007

    tam007

    Joined:
    May 11, 2016
    Posts:
    1
    I have made a UML Diagram about this game tutorial. Anyone please tell me I am right or wrong ? Thank you !
     

    Attached Files:

  24. b33son

    b33son

    Joined:
    Dec 8, 2017
    Posts:
    5
    I can't seem to download the starting files from the Asset Store. The other Tutorials like Tanks are listed, but this one is missing.
     
  25. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    623
  26. b33son

    b33son

    Joined:
    Dec 8, 2017
    Posts:
    5
    That's where I was trying to download it from. When I click on "Open in Unity", my Unity launch window will appear. My Projects On Disk will show. But nothing else happens. If I go to "New" there's no new asset listed for Adventure Game. If I click on the "Learn" tab, the Adventure Game Tutorial is not listed. (Although the other Tutorials are listed there.)
     
  27. AnneSchmidt

    AnneSchmidt

    Joined:
    Aug 8, 2016
    Posts:
    623
    You must create the new project and then the download will begin.
     
  28. b33son

    b33son

    Joined:
    Dec 8, 2017
    Posts:
    5
    Perfect. Thank you that worked.

    In case anyone else was confused too. These were the steps.

    1. Create a new empty project in Unity Editor
    2. Went back to the Adventure Game Asset page in browser: https://www.assetstore.unity3d.com/en/#!/content/76216
    3. Click Link. Asset tab opens in Unity Editor to the Adventure Game
    4. Click "Download". Learn & enjoy.
     
  29. klausenlie

    klausenlie

    Joined:
    Oct 24, 2017
    Posts:
    1
    Hi.

    When I open phase 1 project, I don`t get anything in the hierarchy window. Is it suppose to be like that?
    Same with the sample project.
     
  30. kylerichardson

    kylerichardson

    Joined:
    Jan 5, 2018
    Posts:
    4
    PROBLEM/TLDR: "SetDestination" and "Resume" can only be called on an active agent that has been placed on a NavMesh.

    SOLVED/TLDR: For those who do the same thing as me... This was happening because I drug the Player PREFAB into the GameObject slot of the PointerClick event trigger... If you use the one that is actually in your scene everything works perfectly! User error!

    Hello, first I'd like to say that this is an excellent tutorial series! Unfortunately I am encountering an error that I have not been able to run down. I am currently at the end of 02. The Player(Continued) and have just finished applying PlayerMovement.OnInteractableClick and the PictureInteractable(Interactable) to the PictureInteractable Event Trigger Script: Pointer Click(BaseEventData).

    I run the game, movement and everything works fine until I click on the picture. When I do I get the following errors displayed in the comments, from this function.

    Code (CSharp):
    1.     public void OnInteractableClick(Interactable interactable) {
    2.         if (!handleInput) {
    3.             return;
    4.         }
    5.  
    6.         currentInteractable = interactable;
    7.         destinationPosition = currentInteractable.interactionLocation.position;
    8.  
    9.         // Error: "SetDestination" can only be called on an active agent that has been placed on a NavMesh
    10.         agent.SetDestination(destinationPosition);
    11.         // Error: "Resume" can only be called on an active agent that has been placed on a NavMesh
    12.         agent.isStopped = false;
    13.     }
    I am using Unity 2017.3.0f3 and have made the changes required for the version difference, and replaced deprecated methods as you can see by the use of agent.isStopped = false instead of agent.Resume();.

    Here is a screenshot of my bake settings under the Navigation panel:

    Screen Shot 2018-01-09 at 3.00.07 PM.png

    Here is a screenshot of the Inspector with my PictureInteractable selected:

    Screen Shot 2018-01-09 at 3.01.18 PM.png

    Here is a screenshot of the Inspector with my Player selected:

    Screen Shot 2018-01-09 at 3.03.22 PM.png

    I can provide any additional requested information. Any assistance would be greatly appreciated!
     
    Last edited: Jan 9, 2018
  31. rishavtandon

    rishavtandon

    Joined:
    Jan 22, 2018
    Posts:
    2
    I completed phase 2 of adventure game however after doing all the scripts i am unable to switch between scenes. the player does not go to the market scene.
     
  32. rishavtandon

    rishavtandon

    Joined:
    Jan 22, 2018
    Posts:
    2



    You need to wrap the navmesh agent.
     
  33. Malkalypse

    Malkalypse

    Joined:
    Jan 13, 2017
    Posts:
    6
    I tried testing Phase 2 after completing it, but I only seem to be able to hold one item in my inventory at a time. Attempts to pick up any additional objects result in the following error message:

    NullReferenceException: Object reference not set to an instance of an object
    Inventory.AddItem (.Item itemToAdd) (at Assets/Scripts/MonoBehaviours/Inventory/Inventory.cs:24)

    Any idea what might be causing this?

    ----

    EDIT: After checking again, I realized that I had failed to populate the Inventory script item slots with the item images from the Persistent Canvas inventory item slots.
     
    Last edited: Feb 4, 2018
  34. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    112
    The character teleports to the destination at the very last part of it, this is I guess because they are setting the position = destination when it is reaching the destination. This looks very weird, the player sudently flickering to the destination.
    Anyway to improve this?
     
  35. Zuzukal

    Zuzukal

    Joined:
    Jan 23, 2018
    Posts:
    2
    Currently going through the Adventure Game tutorial and once I get to Phase 2 and upload the assets I am no longer able to move. Tried checking my code and it's accurate. During the import I received a notification saying changes have been made to the Security Room, I'm sure those changes are the problem but I don't know what yet.

    I am currently stuck, I've even deleted the original and started a new with all the assets imported initially and it showed as if I had already done the tutorial (or at least some). This is quite mind boggling to me and am looking for help regarding the issue with importing assets and the changes made.

    Until I figure it out I won't be attempting the Adventure Game tutorial. I really wanted to complete this tutorial but, oh well. Any advice or information is appreciated.

    Thank you
     
  36. KingofWhaWha

    KingofWhaWha

    Joined:
    Apr 13, 2017
    Posts:
    2
    Hi!
    I have already completed the whole tutorial and integrated the reactioncollection to my own project. It works perfectly until I started to work with procedural generation, for which I needed to store a whole "scene" as a prefab.

    (For clarification, this question would be related to phase 3 where you guys implemented the interaction and reaction system.)

    As I mentioned, I needed to save a whole scene to a prefab, but if I drag the prefab up into the hierarchy, all ReactionCollections lose their reactions (Scriptable Objects). You could reproduce this problem if you store PictureInteractable as a prefab, and then dragging it into any random scene. If you then click on DefaultReaction under the instance, you will lose all Reactions attached to it.

    Is there anyway we could make prefabs NOT lose these Reactions? I am working with procedural generated game where each room is stored as a prefab so I need this to work. If not, I would have to rely on scenes to store the Reactions, which has certain drawbacks compared to using just a prefab.

    I know this question might be beyond the scope of this discussion, but if you could provide a solution or even any clue I would be very grateful!
     
  37. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    77
    @KingofWhaWha The way these interactions were designed, they were never meant to exist outside of the scene. Currently they are objects saved in the scene and referenced by the scripts which display them. In order for them to be part of the prefab they would need to be saved to the project - probably as part of the prefab itself. However this is not a normal thing for the Unity editor to do and so you will have to do it yourself. I'm not sure if it's even possible to do specifically what you want but here are some links which might be helpful:
    https://docs.unity3d.com/ScriptReference/PrefabUtility.CreatePrefab.html
    https://docs.unity3d.com/ScriptReference/AssetDatabase.AddObjectToAsset.html
    As I say, I'm not sure it's even possible as I have never tried it myself. If it works, please let me know.
     
  38. KingofWhaWha

    KingofWhaWha

    Joined:
    Apr 13, 2017
    Posts:
    2
    Thanks for info @JamesB! Since I posted the answer I have shifted away from the aforementioned approach, but still I'm insterested in implementing it. If I ever come up with a solution I'll definitely let you know!
     
  39. therealdrayton

    therealdrayton

    Joined:
    Apr 21, 2018
    Posts:
    1
    If anyone is still having this issue, I found the problem. For some reason when the script was created and renamed to "Inventory" it did not change the class name. So the class name stayed as "public class NewBehaviourScript : MonoBehaviour". If you change "NewBehaviourScript" to "Inventory" it will get rid of the error.
     
  40. occulus1975

    occulus1975

    Joined:
    Jan 7, 2017
    Posts:
    3
    Running Unity 2018.1.0 of 2 here (I... guess... that's Unity 5?). I am working my way through the adventure tutorial set and am receiving the following warning:

    "Lighting data asset ‘LightingData’ is incompatible with the current Unity version. Please use Generate Lighting to rebuild the lighting data. Realtime Global Illumination cannot be used until the lighting data is rebuilt."

    Rebuilding the lighting leaves the scene dark and global illumination is thereafter absent from the scene. I can't seem to find a way to get it working again. Does anyone know what I should do? Is the lighting data just broken?

    I've tried going into the lighting panel and rebuilding the data but that actually removes realtme GI- it gets rid of the warning but GI seems to be completely gone after that.
     
  41. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    77
    Hello there @occulus1975. Unity version numbers go 4, 5, 2017, 2018 then next year there will be 2019. We've used this new numbering system because of our change to a subscription model. The Adventure Game was made in Unity 5 and some things are a little bit fuzzy with newer versions.

    In order to get lighting to work you need to use the same bake process we had to use for Unity 5. In the level gameobject hierarchies there should be an inactive gameobject called BakedLights. Activate this gameobject, bake the lighting, then deactivate the gameobject again.

    This was a workaround we had to use due to a problem with the system at the time we made this tutorial. Unfortunately its meant that the workaround has to be used for all subsequent versions. Sorry about that!
     
  42. occulus1975

    occulus1975

    Joined:
    Jan 7, 2017
    Posts:
    3
    That did the trick. Thanks!