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

Runtime Level Design

Discussion in 'Assets and Asset Store' started by XGT08, Jan 17, 2016.

  1. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hello,

    No, input with a controller is not supported. Only keyboard and mouse. There is limited support for touch screen devices, but it only works with gizmos. The most helpful features of the plugin do not work with a touch screen.
     
  2. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hello,

    Sorry for the late reply.

    No, this is not possible. I guess it could be done, but for the moment, I would avoid adding extra checks inside the drawing code.
     
  3. Skaltum

    Skaltum

    Joined:
    Nov 1, 2013
    Posts:
    28
    Quick question: How do I destroy a gizmo I created with
    RTGizmoEngine.Get.CreateObjectMoveGizmo()
    ?
     
  4. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    I have just submitted an update which adds a new function called 'RemoveGizmo' to the RTGizmosEngine class.

    Cheers,
    Andrew
     
    Skaltum likes this.
  5. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    I have bought your asset but I'm now hesitant as to whether to implement it - mainly because unity announced they will be deprecating the built-in-render pipeline and it will be replaced with URP. That being the case I can't in good faith implement an asset that I know is going to stop working and compromise my product in future. Have you had a change of heart on this or do you plan to just let the asset die when built in render pipeline is deprecated?

    I also have a question on the prefab database - how is this shipped in a build, is it part of a scene and are the prefabs all stored within that scene? We currently use our own prefab asset system using asset bundles to stop the resources directory growing to over 2gb, so it is important for us to understand the mechanism of how the prefab database works in a build should we chose to go ahead with it.
     
    Last edited: Oct 16, 2020
  6. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    Trying to work out how I can make it so that scaling will not scale below zero into negative scale values as negatively scaled objects can often cause rendering issues.
    I know I can register for a post drag event and reset the scale of an object that is negatively scaled but ideally what I want to do is make it so that when you scale down when it gets to 0.001 on any axis it just stops scaling, so you can just get really small or increase the size but you can never go into negative scaling.

    Trying to work out where in the code event handlers I would put something like this as I'm not sure any of them are suitable as I don't want to be repairing meshes back to valid scales after the event of the drag. I want the drag to just stop working once you try to head below 0.001 on any axis.

    On screen you would see the object get really small or scale up but never invert.
     
  7. santos9991

    santos9991

    Joined:
    Oct 31, 2018
    Posts:
    17
    Hi Andrew,
    I'm using the latest version 2.2.1.
    When I manipulate the gizmo, scale, move or rotate, the object is deselected.
    The event OnSelectionChanged is fire and the args.DeselectReason = ClickAir

    I'm using URP version
     
  8. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    Thanks for contacting me.

    This issue was fixed in the latest release 2.2.1. Are you using the latest version?

    Cheers,
    Andrew
     
  9. santos9991

    santos9991

    Joined:
    Oct 31, 2018
    Posts:
    17
    Yes, i do.
     
  10. santos9991

    santos9991

    Joined:
    Oct 31, 2018
    Posts:
    17
    I think it's a bug in Unity's Package Manager.
    because I downloaded the latest version, 2.2.1

    but in the RLD Readme.txt file the latest version is 2.2

    "Release 2.2
    ------------------------------------------------------------------
    [New Feature] : added support for URP - there is a limitation: the
    scene gizmo can not be used with URP."
     
  11. santos9991

    santos9991

    Joined:
    Oct 31, 2018
    Posts:
    17
    I cleared the Asset Store cache, downloaded it again and it worked!
    Thanks.
     
  12. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Awesome!
     
  13. CastleSeven

    CastleSeven

    Joined:
    Jan 24, 2018
    Posts:
    6
    @XGT08 , I'm really enjoying your asset, but am having an issue with the preview textures being generated. For most of the cases they work fine, but there are two particular gameobjects that have a null _previewTexture assigned to their RTPrefab instances. It appears these textures get generated only once, when the gameObject is originally added to the library. If I force a refresh of the previews via the editor, the two objects that were missing their textures get generated, but then the rest of them (the ones working previously) go to null. Thoughts?
     
  14. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hello,

    I can refresh the previews with no problem. Regarding those 2 objects that are causing trouble, is there anything special about them? Are they mesh objects?
     
  15. ihsan07

    ihsan07

    Joined:
    Mar 28, 2016
    Posts:
    17
    Hi. How do I get selected objects from scripts? Sorry I couldnt find it
     
  16. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    You can call RTObjectSelection.Get.SelectedObjects. This will return a List<GameObject> instance.
     
  17. ihsan07

    ihsan07

    Joined:
    Mar 28, 2016
    Posts:
    17
    Thanks. Your asset helped us a lot with our project. Keep up the good work.
     
  18. baaleos

    baaleos

    Joined:
    May 12, 2018
    Posts:
    12
    Does anyone know how to dynamically switch to RLD mode?
    My use case - the player is walking around in an existing scene - which could be an overworld (open world outdoors)
    or interior area etc
    They want to enable the RLD - and then place furniture and other gear in their home / base.
    Is there a procedure to achieve this.

    At the moment the documentation says to 'initialize by the editor option'
    then you have to create the RLD Prefab db etc

    Is it possible to save a RLDApp object prefab as a ready made prefab and then just assign a new camera on demand?
     
  19. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,
    I hope you can help me a bit.
    Is there a way to use multiple prefab libraries at runtime?
    The idea is to be able to switch through multiple categories which have subcategories.
    I thought to achieve this by duplicating the RTPrefabLibDB Game Object and than using UI-Buttons to activating/deactivating the specific Prefab Library, however it didn´t work that way as the Title in the DropDownMenu didn´t show the correct active library.

    Another question:
    Is it somehow possible to integrate a search to the prefab library, so that the user can search at runtime for specific prefabs?

    Many thanks for your support

    P. S.

    this is the error which I receive, when I switch the libraries with the buttons:

    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <9577ac7a62ef43179789031239ba8798>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <9577ac7a62ef43179789031239ba8798>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <9577ac7a62ef43179789031239ba8798>:0)
    RLD.RTPrefabLibDb.get_ActiveLib () (at Assets/Runtime Level Design/Scripts/Runtime Package Common/Prefab Management/RTPrefabLibDb.cs:44)
    RLD.RTPrefabLibDb.OnActiveLibDropDownChanged () (at Assets/Runtime Level Design/Scripts/Runtime Package Common/Prefab Management/RTPrefabLibDb.cs:298)
    RLD.RTPrefabLibDb.<Start>b__59_0 (System.Int32 <p0>) (at Assets/Runtime Level Design/Scripts/Runtime Package Common/Prefab Management/RTPrefabLibDb.cs:277)
    UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <0847a0faf94444ccbaf1958021b27f54>:0)
    UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <0847a0faf94444ccbaf1958021b27f54>:0)
    UnityEngine.UI.Dropdown.Set (System.Int32 value, System.Boolean sendCallback) (at F:/Unity-Versions/2019.4.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Dropdown.cs:418)
    UnityEngine.UI.Dropdown.set_value (System.Int32 value) (at F:/Unity-Versions/2019.4.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Dropdown.cs:394)
    UnityEngine.UI.Dropdown.OnSelectItem (UnityEngine.UI.Toggle toggle) (at F:/Unity-Versions/2019.4.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Dropdown.cs:1118)
    UnityEngine.UI.Dropdown+<>c__DisplayClass63_0.<Show>b__0 (System.Boolean x) (at F:/Unity-Versions/2019.4.17f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Dropdown.cs:795)
    UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <0847a0faf94444ccbaf1958021b27f54>:0)
    UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <0847a0faf94444ccbaf1958021b27f54>:0)
    UnityEngine.UI.Toggle.Set (System.Boolean value, System.Boolean sendCallback) (at F:/Unity-Versions/2019.4.17f1/
     
    Last edited: Jan 10, 2021
  20. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    Thanks for contacting me.

    Sub-categories are not currently supported. I am not sure when/if they will be. The errors that you receive, do they appear after you made any changes to the source code?

    I will look into name search and see what I can do.

    Cheers,
    Andrew
     
  21. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,
    thanks for your fast reply!

    A search would be awesome, that´s very kind of you to check out this feature!

    However the ability to use multiple prefab libraries (or subcategories) is elemantary for my project.
    Fyi: I am Using Unity 2019.4.17f1 with standard Render pipeline and as soon as I import RLD I receive the following Error:

    There are inconsistent line endings in the 'Assets/Runtime Level Design/Scripts/Runtime Package Common/Core Types/RenderPipelineId.cs' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
    Assets\Runtime Level Design\Scripts\Gizmos\Scene Gizmo\RTSceneGizmoCamera.cs(2,29): error CS0234: The type or namespace name 'Universal' does not exist in the namespace 'UnityEngine.Rendering' (are you missing an assembly reference?)

    So the only change I did to the source code is in the RTSceneGIzmoCamera.cs
    (//using UnityEngine.Rendering.Universal;)

    and I have commented out: /* if (RLDApp.Get.renderPipelineId == RenderPipelineId.URP) .... */

    Is there a workaround to use multiple prefab libraries at runtime?
    E.g. by using Icons and depending on which Icon is active, the corresponding prefab library with the pulldown-menu will show within the UI. As I mentioned, I tried to achieve this by enabling and disabling the RTPrefabLibDB in the Hiearchy at runtime...

    Do you have any idea how to achieve that?


     
  22. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    I have implemented the prefab search field. Please send me an e-mail at octamodius@yahoo.com so that I can send you the updated pack.

    Cheers,
    Andrew
     
  23. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    awesome thanks a lot, I just sent an email :)
     
  24. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    I don't think the e-mail has been sent. I have not received anything yet. Can you try again please?

    Thanks,
    Andrew
     
  25. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,
    thanks for letting me know.. I just used another e-mail address.
    Please check it again.

    Thanks a lot!
     
  26. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,

    many thanks for the package.
    Could you please check your email & inbox here.
    I am having an issue regarding texture tiling .. this has worked once a while ago, but I am not sure if it´s related to RLD now...

    Also I am still struggling with the usage of multiple RTPrefabLibraries.. if there is any way to achieve that, I would be very happy!

    Thanks again for your support so far!


    EDIT: regarding the package I sent to you: I just noticed this happens only when I build the project.. When I use the Unity Editor everyhting works fine.. any idea?
     
    Last edited: Jan 11, 2021
  27. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67

    Hi Andrew,
    have you been able to check out the video: https://we.tl/t-IgWusrYs5X
    I am not sure if you´ve received my inbox-message here..

    Please let me know if you have any idea how to fix this

    many thanks!
     
  28. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    I have just sent you an e-mail.
     
  29. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67

    Thanks a lot Andrew, Could you please just check your email again
     
  30. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,
    have you received my email?
    It would be great if you could take a look at this.. as I am still struggling with the Prefab Categories..

    Thanks a lot!
     
  31. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hey guys,
    has anyone been able to create multiple prefab libraries (databases) e.g.
    like

    UI Button 1 = Cars
    Prefab Library called "Cars" featueres categories: Ferrari, BMW, Audi...

    UI Button 2 = Motorcycles
    Prefab Library called "Motorcycles" features categories: Honda, Harley Davidson, Kawasaki

    (each category e.g. BMW has it´s prefabs inside)

    Does anyone know how to achieve this with RLD?
    @XGT08 I hope I could explain it this time a bit more precisely .. any idea how to solve that?
     
  32. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    I have already told you that currently only one prefab library database can be created. This is what I had in mind when I designed the system. In that database, you can place multiple libraries. When you initially explained it to me, I thought you wanted one button for each library. It took me some time to realize that you want to have a button for multiple library databases.

    Currently this is not possible. There are a multitude of project requirements and the needs are different from user to user. Unfortunately I can not provide a customized solution for everyone. You could implement your own prefab manager which would bypass the limitations of the built-in one of course.

    Cheers,
    Andrew
     
  33. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi,

    ah ok I didn´t thought it would be that complicated ..
    anyway thanks for your help!
     
  34. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew @XGT08

    I have noticed that my prefabs will be placed below the terrain if I point the camera down..
    As far as I remember we had this issue with an older version of RLD and I am not sure if there´s a function to deactivate that or if you sent me another package back than..

    However.. I would very much appreciate if you could let me know how to fix this (so that all placed prefabs will be at y=0 / same height as the terrain)

    many thanks!
     
  35. larrytran

    larrytran

    Joined:
    Mar 4, 2015
    Posts:
    5
    Hi, what's the best way to implement object to object snapping for touch screen myself? What is in the way of these features for mobile? Is it the key bindings needed with a keyboard?

    For some context, my game is mobile only (no PC version), and I want object to object snapping to be the default behavior for "touchdown and drag". I dont want to use gizmos to move and object. The player just holds and drags it across the screen.

    I am comfortable with scripting, so can you just point me in the right direction?
     
  36. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    Honestly I usually try to stay clear of mobile development. For some reason, it is just not my thing. So I'm afraid I can not provide any valuable hints as to how this might be implemented.

    However, I assume you will have to make the necessary changes in the following file: Object2ObjectSnapSession.cs.
    Inside this file search for the occurence of SharedHotkeys. This property is used to check if certain hotkeys are active and take the necessary action when they are. So you will have to replace this with code that checks for mobile input.

    For example, inside this file, there is an Update function. Inside this function you will find (among other things) the following lines of code:

    Code (CSharp):
    1.            
    2. if (_state == State.Inactive)
    3. {
    4.     if (SharedHotkeys.ToggleSnap.IsActiveInFrame()) Begin(targetObjects);
    5. }
    In this case you will have to replace if (SharedHotkeys.ToggleSnap.IsActiveInFrame()) with something that makes sense for mobile.

    I think for the most part this is what you have to do. You can contact me if you need additional details. Hope this works out for you.

    Cheers,
    Andrew
     
  37. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    HI Andrew,
    could you please let me know which script handles the buttons for pressing "Q" and "T" for example?
     
  38. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    The RTObjectSelectionGizmos.cs file contains an Update_SystemCall function which handles the hotkyes.

    Note however that the hotkyes are not hardcoded. They are configurable via an instance of the ObjectSelectionGizmosHotkeys class.
     
  39. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67

    thanks for your fast reply!
    Could you please tell me how can I turn off certain keys when a specific object is selected?

    I am not sure if it´s a bug within RLD, but I noticed whenever a Light-Object is placed and the user selects the object and than pressed Q or T the Gizmos disappear but if the user is pressing any other key - e.g. spacebar which has no functionality (is no hotkey) the gizmo which has been last used (e.g. if its the transform gizmo W or R if rotate was used) is just staying active... so what we want to achieve is basically the same behaviour as it confuses the user if Q or T is pressed but actually the light can´t be duplicated in a specific direction (Q) or extruded with T

    Any idea how to solve this issue?
     
  40. ihsan07

    ihsan07

    Joined:
    Mar 28, 2016
    Posts:
    17
    Hi XGT08. First of all, thanks for great asset. Secondly, I want to clamp the movement for box scale gizmo, but I am not sure where in your codes the number is manipulated. Any help is appreciated. Have a nice day.

    Edit: I clamped faceCenter value in BoxGizmo.UpdateTickPositions and it only clamped the movement of gizmo.
     
    Last edited: Jan 31, 2021
  41. ihsan07

    ihsan07

    Joined:
    Mar 28, 2016
    Posts:
    17
    Any ideas on this?
     
  42. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    Currently there is no clamping that can be applied to the gizmo and I am not sure how it could be done. Personally, I would leave the default behaviour intact.

    What is is that you are trying to accomplish?
     
  43. ihsan07

    ihsan07

    Joined:
    Mar 28, 2016
    Posts:
    17
    I want to give players the option to change height of created tile but if it goes to negative scales it breaks the game. I loved your box scale option so I wanted to implement that. I turned off all but top gizmo on box scale. It works fine until player drags it so low that its scale is negative values.
     
  44. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,

    I have one short question.
    Could you please let me know which function is beeing called when you place an object from the UI Prefab Library (so that the prefab is beeing instantiated at runtime).

    Which script is handling this?
     
  45. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hello,

    There is an event that is fired when that happens and you can register a handler for it.

    For example, your handler should look something like this:
    Code (CSharp):
    1. private void OnPrefabSpawned(RTPrefab prefab, GameObject spawnedObject)
    2. {
    3.      // Do stuff
    4. }
    And you can register it like this:
    Code (CSharp):
    1. RTPrefabLibDb.Get.PrefabSpawned += OnPrefabSpawned;
    The first parameter is the prefab that was spawned and the second is the object that was spawned from the prefab.
     
  46. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67

    thanks Andrew!
     
  47. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67
    Hi Andrew,

    we have noticed, when the user places a lot of prefabs (let´s say 1000), the build freezes...

    Is it possible to limit the amount of placed prefabs or how many are pasted per frame or ideally both
    so that we can at most store 20k objects in the clipboard and when we paste them it would paste at most 250 objects per frame (or however many is low enought to not make the application freeze) so instead of trying to paste all 1k in a frame, making unity freeze up, it would distribute that over 4 frames...

    Could you please let me know how if this could be done?
     
  48. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hi there,

    Do you mean a limit on the number of objects that are placed in the scene? No, there is no way to limit this. I am not sure how I could do that right now. Besides, RLD does not contain a paste operation. If this paste is something your app supports, you can surely implement a script that handles the limit.

    Unity allows you to create objects from prefabs using the Instantiate function. If you call that function with 1000 objects it might be slow depending on how complex the objects are.

    EDIT: What do you mean by paste? Are you talking about RLD's selection duplication?
     
    Last edited: Feb 12, 2021
  49. xkingjohnx

    xkingjohnx

    Joined:
    Feb 22, 2016
    Posts:
    67

    Hi,
    I was just talking about the instantiation / placing objects at runtime, wheather we do this via the UI panel, (which would take forever for 1000 prefabs) or via the Duplicate-fuction (CTRL+D or "Q")

    The point is just, that when too many Prefabs are placed in the scene at runtime, everyhting freezes and I guess depending on how good your PC is this would happen on some machines with fewer prefabs and on some with a bigger amount of runtime placed prefabs, but even if we use different solutions for performance-increasement at runtime (LODS, Gpu Instancing etc) it will still occur sooner or later...

    So the goal is.. how can we keep the Build always running stable?
     
  50. Kaktusz

    Kaktusz

    Joined:
    Jan 17, 2015
    Posts:
    9
    Hi, how would I go about recording my own changes to the Undo/Redo system? Say, I change the colour of one or more objects with my own script. I'd like this to be saved as one undo/redo action. Thanks!