1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  3. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  4. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  5. Unity 5.5 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  7. Unity 5.6 beta is now available for download.
    Dismiss Notice

[RELEASED] Snap-and-Plug: join anything to anything

Discussion in 'Assets and Asset Store' started by a436t4ataf, Sep 15, 2014.

  1. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Download now: https://www.assetstore.unity3d.com/en/#!/content/21930

    Turn your GameObjects into Lego-like bricks, where anything can connect to anything, odd shapes, curves etc - and yet snapping precisely together.



    *new*: (August 2016) works in Play mode - use realtime snapping directly in your game.

    Website with demo videos, etc: http://snapandplug.com

    Example uses:
    • BUILD LEVELS: ...with wiggling corridors, odd-shaped rooms, no constraints! (no grid!)
    • AI/Enemy scripting: ... all the info is available to your scripts (e.g. I made a procedural dungeon this way, and the AI uses the snapping-information to navigate around the dungeon at runtime)
    • Vehicle/building construction: place sockets on a car-prefab's axles, and "snap" wheels of different sizes, shapes. Put sockets on front and sides of a building-prefab, and "snap" different doors, windows, etc
    • City-building: snap some buildings together to make a block, then snap blocks together to make a city
    Usage:
    • Drag/drop within the editor
    • Drag/drop in your game (requires you to write your own scripts that connect your game-controls to the API)
    • Interactive connections, pieces, sockets
    • Tutorials + videos are on: http://snapandplug.com

    Screen Shot 2014-09-15 at 09.55.42.png Screen Shot 2014-09-15 at 09.55.52.png
     
    Last edited: Aug 28, 2016
    Teila and rakkarage like this.
  2. b4c5p4c3

    b4c5p4c3

    Joined:
    Jan 4, 2013
    Posts:
    514
    Looks useful. I'm subscribing to this thread.
     
  3. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    I will definitely be interested once you add run-time editing! :)
     
  4. -Singularity-

    -Singularity-

    Joined:
    Jul 27, 2014
    Posts:
    102
    I'm interested in this too - do you have an ETA?
     
  5. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    I was hoping to submit on Monday, but I realised that my tutorials sucked, so I'm re-doing them now.

    New ETA: next Monday.
     
  6. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Yeah - I need it myself for one of my own projects, ASAP :). So I'm very keen to add this.

    BUT ... how soon it happens will depend on how many people use the first version, and how much they like it. It's only a small asset, but it took me months (!) to get right. If it only gets a small amount of use then I'll be focussing my time on supporting the existing version rather than adding major new features.
     
  7. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    That makes sense.

    I am in the process of making houses with snap together parts so I can customize them easily before putting in the game. This would be very useful. A grid is great but snapping a roof to a house base would be easier with sockets. So I will seriously consider buying this even without the run-time feature. However, it would be nice if a player could put together the parts in the game or exchange a thatch roof for a tiled roof, etc. :) I can see all sorts of cool ways to play with this.

    I am passing this on to some of my multiplayer developer friends to see if they might also be interested. I think you could find a market out there.
     
  8. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    This tool is nice, but what makes it amazing is when you've configured intelligent Sockets for each model.

    So ... I'm working with some asset-authors to do special versions of their model packs which are pre-configured with the relevant Sockets.

    If anyone has an assetpack (buildings, dungeons, etc) that they'd like to upgrade, please get in touch directly (@t_machine_org). My aim is that you publish your upgraded pack as a separate AssetStore asset - it's more useful to purchasers, BUT it requires that people already have this Editor Extension (so it's something you'd want up "in addition to" the simple model packs)
     
  9. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    How difficult is it to set sockets on the models yourself? Will there not be enough documentation to actually figure it out? I hope so.
     
  10. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    It's easy to do yourself. I designed it for artists to use directly.

    I've just put a website up with the core tutorials: http://snapandplug.com

    ... The most important tutorial is the basic snapping: http://snapandplug.com/?page_id=13

    ... There's also a tutorial on writing your own custom Renderers to draw odd-shaped sockets: http://snapandplug.com/?page_id=39

    Have a look - it's actually easier to work out in practice, as everything is context-sensitive, but hopefully the tutorials give a good idea of what you have to do. Questions welcome!
     
    Teila likes this.
  11. Brian-Ryer

    Brian-Ryer

    Joined:
    Mar 5, 2013
    Posts:
    31
    I will definitely purchase this when you release it, and fingers crossed for runtime snapping.
    Good luck with developing and sales. :)
     
  12. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    It's submitted! Waiting on Unity to approve it...

    (I've also cleaned up the website a bit, made it more readable, added an extra video, and some more details on the tutorials pages)
     
  13. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    Yay! Thank you. Looking forward to your asset.
     
  14. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    Question, I read your website and am confused about something. It says you an add a SnapSocket to an object that has no other SnapSocket attached. Does this mean you can't add two to an object? If so, it seems you could not make a dungeon that has halls that go in different directions. The entire dungeon would be a line of joined rooms. Is this correct?

    I had hoped to use this to join pieces of buildings together but I would need to join more than one part to each building pieces.
     
  15. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Sounds like a typo, sorry! Which page is that on?

    To prepare for runtime sockets later, it works like this:

    (your object) - various components, including ONE SnapPiece
    |
    +--- A gameobject with ONE SnapSocket
    +--- A gameobject with ONE SnapSocket
    +--- A gameobject with ONE SnapSocket

    ... i.e. each SnapSocket is on its own gameobject, BUT ... you have a bunch of those gameobjects parented to "whichever gameobject has the SnapPiece".

    Originally, I had it that all the SnapSockets were data hiding inside the SnapPiece, using a custom Inspector to view/edit them. But for runtime, that would be terrible :). So I moved it to this setup.

    As a bonus, you can use all the standard Unity mouse/keyboard shortcuts for moving and positioning your SnapSockets on your model/mesh/whatever.
     
  16. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    So could I do this?

    A base house, first floor with a snap piece on top. A second piece with a beams and a loft that snaps to the top of the house. Then a third piece, a roof, that sits on top of the beams and snaps. In this case, each piece would be connected in a vertical sequence. Now, could I add a second snapped object to the front of the base house? Like a porch? It would require a second snap slot.

    In this scenario, the base house would snap to an object on top, and an object on the side, so two objects, two different snaps.

    Am I making sense? I want to be able to put together modular pieces to build houses/buildings that don't all look exactly alike but saving on modeling.
     
  17. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    That sounds exactly the kind of thing it supports.

    If you try it and get stuck, let me know and I'll see what it takes to MAKE that work.
     
  18. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    5,185
    Great thank you! I am watching for it on the asset store. :)
     
  19. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
  20. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    No reviews. Have any of you tried it yet? Successes? Failures?
     
  21. Brian-Ryer

    Brian-Ryer

    Joined:
    Mar 5, 2013
    Posts:
    31
    Hi a436t4ataf.
    Just bought your asset just now, going to play with it and will be sure to write you a review on the store.
     
  22. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    I've described the "doesnt work at runtime" thing badly. I've corrected the original post:

    The only thing that's missing at runtime is the GUI for drag/drop in-world to connect pieces together; all the rest works fine at runtime.

    (e.g. I build some levels by hand in the editor, and others I build procedurally by randomly snapping pieces to other pieces. Some I do both: run a procedural generation to make different levels until I find one I kind of like, and then hand-edit by unsnapping/re-snapping pieces until I like it)
     
  23. -Singularity-

    -Singularity-

    Joined:
    Jul 27, 2014
    Posts:
    102
    So, if we have a player instantiate a prefab at runtime, lets say a rectangular plank, as long as it has the correct sockets set up it should auto snap to any other object with the correct sockets?
     
  24. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Yes. The only question is "how do you trigger the snapping?" - since at runtime all of Unity's gizmos etc are deleted from your binary (as part of the build process).

    You need to write code that gives the user an interface to choose a pair of objects, and choose which socket to connect to which. Snap-and-Plug then has one line of code that you invoke that does the "snap" - but you have to decide which socket/object first!
     
  25. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    498
  26. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    That should work fine, but you'd have to write some simple code to connect the two assets together (there's no built-in way for the assets to talk to each other).

    I don't know how the rigidbodypickup asset works, but it probably has a callback at some point, and you'd put maybe as little as 1 line of code there to make Snap And Plug actually connect. There are docs on this on the SAP website - http://snapandplug.com/?page_id=39

    (you should only need to call ConnectWithoutMoving(..) or ConnectByMovingToJoinDoorway(..))

    If you're in touch with the author of rigidbodypickup, I'm happy to work with them to test this. It should be very easy! But I don't have the asset and haven't used it myself.
     
  27. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    498
    Thanks for the quick response, I'm actually going to buy this asset later today so I will test everything then. Also is something like "selective snapping possible"? For example, I would want to snap planks together to construct a hut, and the base of the hut to snap with the floor. But I wouldn't want my table to snap with floor as I want it to be dropped and still a physics object. Does that make sense?
     
  28. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Yes and no.

    You choose the "type" of each socket, and things of same type can ONLY snap to things of same type. A single prefab/gameobject can have mutliple sockets, each of them different types, but ... a socket CANNOT be multiple types.

    (only because: that would make the code a lot more complicated, and the snapping harder to use!)

    If you need a socket to snap to two different things, get in touch via email (address on the site) and I'll see if there's a neater solution. I've THOUGHT I needed it, twice, and both times I realised there was a simpler solution.
     
  29. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    498
    I haven't watched the tutorial videos yet so I'm not fully understanding the terminology, sorry :p but I'm guessing sockets are things that can be snapped? And what are the different types?
     
  30. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    1. Take your GameObject / prefab, and "add socket" for as many snap-points as you want
    2. Optional: choose a "type" for each Socket. Sockets of same type snap only to sockets of same type.

    The types are up to you! You can create as many as you want, and then it gives you a dropdown to select from them.
     
  31. Skaeren

    Skaeren

    Joined:
    Feb 9, 2015
    Posts:
    14
    I have a question: Can this be used, for example, to allow players to assemble their own vehicles, in a style similar to TerraTech or RoboCraft? If so, how would you do it?
     
  32. Skaeren

    Skaeren

    Joined:
    Feb 9, 2015
    Posts:
    14
    Also, will objects using this work with the various mesh destruction assets in the store?
     
  33. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    This would work very well for doing TerraTech style games - it does most (very nearly all!) the behind-the-scenes work for you. The one thing missing at the moment is that there's no built-in way for you to automatically rotate the connected pieces while keeping them connected - the code for that isn't much (it's easy if you're a coder), but it's not trivial (it's hard if you're a non-coder).

    For mesh destruction, it depends on the quality of the mesh destruction asset. If they've written it sensibly, it will work fine - the joints will NOT come apart automatically (how could they? It's up to you to decide what causes them to break, and to break them :)), but the rest will not interfere.

    ---
    What you need to do yourself (to recap):

    1. There is no in-game UI for Snap and Plug; every game I've seen / written uses it differently.
    2. Do you want to drag/drop pieces into place (as in 2D games)? Or use physics to lift and float them (as in Terratech)? Or teleport them (as in WoW/Diablo/etc)? ... up to you to decide and implement
    3. If you want the joints to (dis)connect under special circumstances, you need to write the code to trigger that. The actual connect/disconnect is a single line of code, and make everything happen automatically - but you need to invoke it!
     
  34. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Also ... if there's enough interest ... I could make a new pack that includes this but provides full Terratech style connection, with in-game UI etc. It's a fair amount of work, so I'd either need to make a new asset, or increase the price of Snap and Plug.

    (I'm thinking: include Snap and Plug, add the "rotatable joints", add a drag/float UI in-game, add some ingame ghost previews (wireframe rendering of what will happen if you let go of LMB right now), and make a demo scene that lets you plug things together interactively)
     
    pixelsteam likes this.
  35. Skaeren

    Skaeren

    Joined:
    Feb 9, 2015
    Posts:
    14
    I would most cetainly be interested in such an asset!
     
  36. Skaeren

    Skaeren

    Joined:
    Feb 9, 2015
    Posts:
    14
    Any idea how long such an asset would take to make, if you did decide to do it?
     
  37. Sami_

    Sami_

    Joined:
    Apr 12, 2015
    Posts:
    1
    Does this work with 2D colliders as well?

    And can you confirm that this works with Unity5? When trying to purchase it from AssetStore it warns:

    Possible incompatibility with Unity 5
    This package was published using Unity 4 and contains asset types which may not upgrade cleanly to Unity 5:
    • Compiled assemblies
    While Unity will generally attempt to upgrade assets to work, problems may still occur.For more information about upgrading projects to Unity 5, please refer to the Unity 5.0 Upgrade Guide.
    For more information about the compatibility of this specific package, please contact the publisher directly.
     
    Last edited: Apr 12, 2015
  38. fermas

    fermas

    Joined:
    Sep 21, 2015
    Posts:
    15
    I would also want to know if this works with Unity 5. I am particularly interested in using during runtime (I will write the in-game GUI of course)
     
  39. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    It should be fine with Unity 5.

    Unity 5.2 is the first really stable release, so I'm starting to move projects over now, and will update quickly if I get problems. (although I wouldn't recommend Unity5 for production yet - 5.3 looks like it'll be production quality. The number of bugs Unity is fixing with each small point release is still ENORMOUS).

    If you have any problems with 5, I'm very happy to take bug reports (email me - options on the Contact page of website, http://snapandplug.com/?page_id=54 ) and either fix quickly, or refund you immediately.
     
  40. lighting

    lighting

    Joined:
    Dec 21, 2011
    Posts:
    35
    This asset really look ideal for my needs. I need to use it both in runtime and editor. I hope, I'll manage to add sockets from code in runtime :)

    Thanks for this asset
     
  41. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    I was hoping to release a runtime add-on over Xmas, but I ran out of time :(.

    I probably won't get time to work on it again until February - we've got 60+ hr weeks this month :(.
     
  42. mzr

    mzr

    Joined:
    Jul 25, 2014
    Posts:
    10
    It looks cool, great idea. I think I'm gonna buy it.
     
  43. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Last chance to buy at current price - I'm about to release a major update and will be putting the price up.

    If you buy now and want immediate access to the new features, I'll send you the beta / pre-release build while I'm finishing up.

    New features:

    * In-game snapping, with source code and demo scene
    * Some minor bug fixes
    * Unity 4 and 5 builds (Unity 4 build not ready yet, might be a week later in releasing that)

    The main thing I've been working on is a "best of breed" design for snapping objects in-game. The in-game snapping was easy enough to add, but making it work beautiully simply for players is much harder.

    (I'm adding in-game snapping to one of my own games, so I wanted something REALLY good for it!)
     
    lighting likes this.
  44. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Video of latest beta build, showing in-game snapping:



    Left pane is Scene view, where you can see the gizmos etc.
    Right pane is Game view, where you can see the player directly building in-game stuff.

    I'll include this scene in the next release so you can play it for yourself. Source code for the in-game stuff is included too - if you want to use this as a starter, but change/improve the GUI so it's better integrated in your game.
     
  45. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Building cars in-game by snapping wheels, engines, etc together:

     
  46. lighting

    lighting

    Joined:
    Dec 21, 2011
    Posts:
    35
    Hello. I've bought initial version and I'd like to know what are new features in new versions as well as how to get it if possible ?

    Regards,
    Maciek
     
  47. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Send me your email address and the Unity Asset Store license number, and I'll email you a link to current beta.

    Main change is the runtime / play mode snapping, but there's also some new demo scenes and bug fixes.
     
  48. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    I've just sent out the penultimate Beta build to beta-testers.

    Fingers crossed it works well, and we could have Version 2 live before the end of this month! :)
     
  49. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Coming up to the final beta now ... I'm writing new tutorials / demo scenes etc.

    But I need more asset packs to really show-off what you can do - ones that have irregular shaped rooms / objects (i.e. not a grid).

    Any favourites you'd like to see upgraded?
     
  50. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    95
    Video from one of the Beta builds (quite long, unedited!)