Search Unity

Sticky Stick Stuck

Discussion in 'Assets and Asset Store' started by LaneMax, Feb 14, 2014.

  1. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Sticky Stick Stuck allows you to easily joint gameobjects together by touch using Unity's joint system 2D or 3D, no code required.

    DEMOS: PC & MAC,

    VIDEOS: BASIC OVERVIEW

    SSS Features Include:
    - Currently Supports Fixed 2D/3D, Spring Joint 2D/3D, Character, & Hinge Joints
    - Weapons FPS, & Weapons 2D Demo Scenes
    - Parenting Gameobject System on Stick
    - Stick on Impact Velocity
    - Stick, UnStick & Break Events Properties
    - Stick Recursively through Objects
    - GameObject, Tag, and Layer filtering
    - Fully Customized Gizmos for SSS
    - Full Source Code
    - No DLLs
    - Unity 5 Ready

    OTHER LINKS:
    Discord
    Unity Forum
    SSS Website
    Resurgam Studios
     
    Last edited: Dec 29, 2020
  2. datadebaser

    datadebaser

    Joined:
    Mar 6, 2013
    Posts:
    8
    hi - will you plan to make stickystickstuck compatible with Unity5? I tried importing it, and running the auto scripting conversion, but there are still a few errors related to new spring class..
     
  3. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey datadebaster,

    Yeah looks like Unity5 broke my stuff =( I'm in the middle of trying to make the changes. For now you might have to be stuck in 4.

    If you know how to jump into some code, a work around is to comment out lines 418,419,430,431,436,337 like this in StickyStickStuck.cs:

    Code (CSharp):
    1. //lowTwistLimit.spring = this.stickProperties.characterProperties.lowTwistLimit.spring;
    2. //lowTwistLimit.damper = this.stickProperties.characterProperties.lowTwistLimit.damper;
    3. newConnectedObject.characterJoint.lowTwistLimit = lowTwistLimit;
    4. SoftJointLimit highTwistLimit = new SoftJointLimit();
    5. highTwistLimit.limit = this.stickProperties.characterProperties.highTwistLimit.limit;
    6. highTwistLimit.bounciness = this.stickProperties.characterProperties.highTwistLimit.bounciness;
    7. //highTwistLimit.spring = this.stickProperties.characterProperties.highTwistLimit.spring;
    8. //highTwistLimit.damper = this.stickProperties.characterProperties.highTwistLimit.damper;
    9. newConnectedObject.characterJoint.highTwistLimit = highTwistLimit;
    10. SoftJointLimit swing1Limit = new SoftJointLimit();
    11. swing1Limit.limit = this.stickProperties.characterProperties.swing1Limit.limit;
    12. swing1Limit.bounciness = this.stickProperties.characterProperties.swing1Limit.bounciness;
    13. //swing1Limit.spring = this.stickProperties.characterProperties.swing1Limit.spring;
    14. //swing1Limit.damper = this.stickProperties.characterProperties.swing1Limit.damper;
    15. newConnectedObject.characterJoint.swing1Limit = swing1Limit;
    16. SoftJointLimit swing2Limit = new SoftJointLimit();
    17. swing2Limit.limit = this.stickProperties.characterProperties.swing2Limit.limit;
    18. swing2Limit.bounciness = this.stickProperties.characterProperties.swing2Limit.bounciness;
    19. //swing2Limit.spring = this.stickProperties.characterProperties.swing2Limit.spring;
    20. //swing2Limit.damper = this.stickProperties.characterProperties.swing2Limit.damper;
    Sorry for the inconvenience, hope to have it updated soon
     
    Last edited: Apr 3, 2015
  4. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Now that Unity 5.3 is out, I should have some good stuff coming soon... So keep an eye out ;)
     
  5. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Sneak peek

    ScreenShot.png
     
    Wavinator likes this.
  6. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Version 2.00b1 is up!
     
  7. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Hi Lane I recently purchased both of your assets - Circular Gravity Force and SSS. I'm trying to utilize both or either asset to attach a "sibling game object/target" to a collider on Rope generated by the asset "Rope Editor" . Basically I'm making a suspension bridge and there are 4 places on either side of the wooden platform that need to connect to the rope's colliders. The bridge is not physically combined but is made of various parts that is parented. I have successfully attached a sphere to the rope's collider and it moves with it smoothly but trying to attach a specific spot on the bridge to the collider hasn't been working. If either of your assets could work with it I would love to know how. Does sticking together two non rigid body game objects work?

    Also just to note about your hinge issue.. I discovered an issue with the Rope Editor - the pivot of the game objects that the ropes are connected to has to be pointed in the same direction otherwise the rope physics go all wirey - it might be a similar issue with setting up hinges. Are multi-meshes in prefabs only capable utilizing the physics properties?

    Lastly a Request for SSS if possible, the ability to drag game objects into the script, and or tags to specifically identify game object to be affected. or not effected.

    Thank you for time, Kurt.

    Update: Solved the bridge issue.. I had not been utilizing a 3rd party collider asset the way it was needed. Anyway I hope I can get around to making a demo because I think you'll like how I used your circular gravity force asset with this bridge.
     
    Last edited: Jan 23, 2016
  8. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey Ascensi, there is an option to stick to non-rigidbody, there is an checkbox named 'Stick To Non Rigidbodys' try that and see if that works.

    Yeah working with hingjoints in the newer 5 versions has been problematice. There seems to be a Unity bug when dynamicly creating hingjoints. They don't work when 2 rigidbody objects touch, but do work when a rigidbody and a non-rigidbody touch, its a weird case. If the Unity doesnt fix it anytime soon I might just pull the hingjoints options sadly.

    Also some good news, I do have a filtering system in place for gameobjects, tags, and layers, its been submited and waiting for approval from unity.

    Nice, glad that you got the brige issue fixed, let me know if you need any other help.

    Cheers!
     
  9. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Still experimenting but I had to drop SSS and use Unity's Fixed joint and this worked but is too time consuming and tedious. It would be ideal if your asset would work on the rope editor out of the box as it would be quicker and simple to set up. I've tried using "stick to non rigidbody" but it doesn't work with rope editor. Maybe there is something in the Rope editor's rope generation that isn't on the list for SSS to attach to? Skinned objects with the colliders inside maybe?
     
  10. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hmm, whats the rope editor asset you use? I might have to check it out
     
  11. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    Hi Lane its called "Ultimate Rope Editor". Thanks for looking into it if you decide to. If you can make SSS compatible with it I can promote that I used your asset in the Youtube video I'm working on if you approve after seeing it.
     
  12. Realform

    Realform

    Joined:
    Mar 20, 2015
    Posts:
    9
    Hello Lane, im trying to implement SSS2D but no chances to go through any suggestions? ´cos i havent figured out how to use it well and im about loose all time i have to develop this project thanks in advance
     
  13. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey Realform,

    Are you able to get the 'Weapons 2D.scene' working? Also do you have a rigidbody2D and colliders2D attached to your game object?
     
  14. jevans70

    jevans70

    Joined:
    Mar 5, 2016
    Posts:
    1
    Can not get this working for 2d sprites?? I have a 2d collider and 2d rigidbody on the gameobject
     
  15. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    There is two different components, one for the 2D Unity engine, and one for the 3D Unity engine. If you want it to work with any 2D collides use the SSS2D.cs component, if you want it to work with regular 3D use the SSS.cs component.
     
    Last edited: Mar 29, 2016
  16. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi there, just downloaded the demo and it looks a lot of fun. I just have a question before purchasing:

    Would it be possible, either now or in the future, to add the sticky to each foot collider of a playable animal, such as a gecko, so that when it moves it will join to the surface allowing it to walk upside down, but when it walks it will release the sticky until the foot comes into contact with the surface again? In theory I couldn't see why this wouldn't work, my only doubt comes from the accuracy of the sticky. The sticky would need to be strong enough to hold the animal upside down, but weak enough to break when the foot leaves contact with the rock, tree, etc.

    Thanks a lot
     
  17. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey jonfinlay,

    Yes this is possible, there is however a catch, you will need to make the gecko completely physics driven in order to get this to work right. It will probably look something like this:



    How I would try tackle this problem is maybe play with the joint break values, or the enable properties under the sss.cs component. Let me know if this helps

    Cheers!
     
    jonfinlay likes this.
  18. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Good to hear! I've already thought of a few good uses for this package so I'll most likely buy it later this week. Thanks a lot.
     
  19. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Awesome! Let me know if you need anything.

    Cheers!
     
  20. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi, I finally bought it and have made an observation. When I shoot an arrow towards a sphere, or a tree with a capsule collider the arrow often gets stuck to the side of the object. In the case of the tree it could be that collider doesn't fully match the tree, however not sure what is causing this issue with the sphere. One solution I think would be to add a variable which allows it to stick depending on the angle it strikes the collider. For example, head on hits would cause the sticky to stick, but hits at less than right angles would cause it to ricochet. This would solve the problem of the trees, so that they didn't need overly precise colliders since it would only stick when hit towards the centre.

    I also checked using this free Iguana the ability to add it to the root motion character controller already included. What I found is that is does stick, and the root motion causes it to unstick (I had Break Force and Torque set to 50), and it looked great. However it does cause the iguana to slow down, doesn't turn very easily and will fall if in a vertical position, although I still think it is possible with a bit more tweaking.
     
  21. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194

    That's really cool, the angle idea is a great solution, I'll have to start working on it :) maybe in the next update. Also I'll haven't to play with the root motion idea too. Thanks for the feedback!
     
    jonfinlay likes this.
  22. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194

    Hey Ascensi,

    Quick update on the hinge issue, looks like Unity fixed the bug. Hinge currently work in Unity 5.4.0b20 =)
     
    jonfinlay likes this.
  23. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    185
    Hey I was curious if there was a way to enable and disable this at runtime? I am making a VR sword game in which the player puts the sword on his belt. I thought this might be good if it was able to be stuck to the virtual belt and turned off when the user grabs the sword off his belt?
     
  24. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Yep, its just the Enable checkbox

    Untitled.png
     
  25. beowulfkaine

    beowulfkaine

    Joined:
    Apr 3, 2014
    Posts:
    185
    Well I mean for example from a VR console. Like for example through a button toggle or script that toggles on and off?
     
  26. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Sure, should just be like any other properties on a unity component. Here is a script example:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. using StickyStickStuck;
    5.  
    6. public class SSSToggle : MonoBehaviour
    7. {
    8.     //Supply Stick Stick Stuck gameobject
    9.     public SSS sss;
    10.  
    11.     // Use this for initialization
    12.     void Start()
    13.     {
    14.  
    15.     }
    16.  
    17.     // Update is called once per frame
    18.     void Update()
    19.     {
    20.         //Enables SSS when pressing Spacebar
    21.         sss.Enable = Input.GetKey(KeyCode.Space);
    22.     }
    23. }
    24.  
     
  27. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Right now there isn't really a way to remove one particular connected without disconnecting all of them through the enable or disable bool, unless the joint breaks. But your right there should be an easy way to do this, I'll try adding a way in the next update, I think this would be pretty useful. If you're code friendly there is a list of every connected object within a List of ConnectedObjectData under the SSS component if you want to take a stab at it, but let me see if I can get in the next updated and I'll let you know.
     
  28. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    I know this asset is probably not specifically made for that, but, could I use it to attach things like helmets, hats or accessories on my characters? (and at runtime?)

    Basically, for my current project my character's are toony biped animals, many don't even have hands (only small wings and stuff), so there's no clothing to be changed, it's all going to be things for the head or accessories to be stuck on the characters body. In short, I only need to attach stuff like I mentioned before (helmets, hats, ribbons, or small accessories), so I feel an asset like ooti's mountpoints would be overkill (higher priced overkill too...). And I've just found out about this asset and it looks really useful (specially for projectiles), so I've been thinking of getting it, and was also wondering if I could use it for my equipment too. Do you think it would be possible to achieve this?

    Anyway, any advice would be greatly appreciated.
     
  29. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    In theory you could, as long as the character parts, and weapons have colliders and a rigidbodys, but I don't really know how well it would work, It might be kind of clunky.
     
    Alverik likes this.
  30. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    umm, is that all the requirement to work? (colliders and rigidbodies?). Do you have methods/functions I could use to get the objects stuck on the character quickly? (like, when clicking an item). Ah, by the way there won't be "weapons" attached to them, if I do use weapons they'll be floating in the air ("by magic"), so, when I say accessories I mean things like badges.

    Any idea what the workflow might be like? How would you do it? (and what did you mean by clunky? if it's about been an inelegant solution, then I don't mind it, lol.)

    Anyway, sorry for so many questions, but I'm sort of new to unity and programming, so any advice is greatly appreciated.
     
  31. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi, after the last update, I'm getting the following error messages:

    Assets/ResurgamStudios/StickyStickStuck Package/Scripts/Editor/Follow_Editor.cs(12,26): error CS0246: The type or namespace name `Follow' could not be found. Are you missing a using directive or an assembly reference?

    Assets/ResurgamStudios/StickyStickStuck Package/Scripts/Editor/Follow_Editor.cs(12,6): error CS1502: The best overloaded method match for `UnityEditor.CustomEditor.CustomEditor(System.Type)' has some invalid arguments

    Assets/ResurgamStudios/StickyStickStuck Package/Scripts/Editor/Follow_Editor.cs(12,6): error CS1503: Argument `#1' cannot convert `object' expression to type `System.Type'

    Any ideas what could be causing these? Thanks

    EDIT: Importing Follow.cs fixed these errors. I hadn't imported this as I believed it was part of the examples, which I didn't want to import. Would be nice in a future update to separate the examples from the essential components.
     
    Last edited: Jul 30, 2016
  32. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Thanks for the heads up, I'll see if I can find a better place to put those
     
  33. ChainsawFilms

    ChainsawFilms

    Joined:
    May 28, 2016
    Posts:
    18
    Hello. I am using SSS to connect a character to a rope. I have a collision trigger, and if anything tagged Rope enters it, I am looking to turn on SSS and create a joint.

    I can't work out how to position where the joint is. I want the joint to be on a set location on my character (ie the hands during the Swinging animation). At the moment, the joint is created on contact and that is that. I have tried a HingeJoint and setting the anchor but that did not work.

    Thanks in advance,

    Matt
     
  34. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    I'm interested in purchasing this- just have a few questions-

    Can you filter the sticky objects by layer similar to CGF? How do you control what objects stick to the object with the SSS script on it?

    I watched the video but I didn't get a sense of how to do that- I see a "stick on sticky" checkbox- is that a way to control what the SSS script/object sticks too?

    Thank you.
     
  35. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey ChainsawFilms,

    The joint is only created at the point the SSS object touches the other object. If you wanting to create a joint at a set location you should probably not use the SSS, and just manually create the joint.
     
  36. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey mdotstrange,

    Yep there is pretty much the same filtering options as CGF, by GameObject, by Tag, and by Layer
     
    imaginationrabbit likes this.
  37. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Thanks for the reply- I'll be picking it up then :)
     
  38. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @LaneMax Using Unity Pro 5.5.0f3 getting the compile error
    Assets/ResurgamStudios/StickyStickStuck Package/Scripts/StickyStickStuck/SSS.cs(833,41): error CS0066: `StickyStickStuck.SSS.OnUnStick': event must be of a delegate type
    I'm not programmer so I'm not sure how to correct it or if it's just not yet compatible with my unity version.
     
  39. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey Ascensi,

    I cant seem to reproduce this, do you have the newest version of Stick Stick Stuck? It should be 2.00f2
     
  40. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    no worries, I think my project got a bit corrupted .. will have to port the files over to a new one.
     
  41. yamlCase

    yamlCase

    Joined:
    Apr 13, 2017
    Posts:
    34
    Is there a way to allow unlimited Max Effected Items?
     
  42. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Don't think so, you basically have to just set the Max Effected Items to a high number. Out of curiosity why would you need it set to unlimited?
     
  43. yamlCase

    yamlCase

    Joined:
    Apr 13, 2017
    Posts:
    34
    I don't necessarily need it unlimited per se, I just want not to have to come up with an arbitrary number that would exceed my wildest dreams. My idea is to have a rotating planetoid/asteroid with an indeterminate number of objects being spawned that need to stick to the surface. I suppose another way is to have these objects become a child of the planet.
     
  44. xxZABxx

    xxZABxx

    Joined:
    Dec 5, 2017
    Posts:
    1
    Interested in this asset. My question is, I'm looking for a clean and customization solution to creating a grappling hook gun effect for me shooter / survival project. Think sort of like spiderman's web-sling ability? Fires out a rope. Connects to impact point. Ideally if they are jumping or falling it will take the momentum and continue the swing in an arc.
     
  45. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Hey @LaneMax,

    Do you know how to get this to work with UFPS? I have a hard time to get something to stick to a UFPS character... I've set the spears from the example scene up so that it hits only the ragdoll layer, but no luck...

    Thanks
     
  46. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hey Lohrion,

    In order for a Sticky Stick Stuck to stick you'll need a rigidbody and a collider on the object you wanna effect including each part of the ragdoll, so make sure you add both. Also make sure that each part of the ragdoll that has the rigidbodys is set to the ragdoll layer, lastly make sure that's the only filter settings. Let me know if this helps.

    Cheers!
     
  47. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Thank you for the quick reply! I'm afraid it still doesn't work... The spear just doesn't stick. See this screenshot for reference:

    SSS UFPS.JPG

    I've added the name of the game object to the log hit output. In the highlighted log message, you can see that it first hit Spine1. On the right side you can see the inspector for that game object. It has a rigidbody and a collider attached, and it is on layer Ragdoll. Yet, it doesn't stick to that collider and continues it's flight, hitting the arm next, and so on until it reaches the floor.

    I've attached a second screenshot of the modified spear prefab:

    SSS UFPS 2.JPG
    The layer mask filter is assigned to Ragdoll, so that should match. All other filters are empty (size 0). The impact velocity on the log statement was also higher than the minimum velocity.

    I'm failing to identify the issue. Do you see any culprits on the screenshots?

    Regards
     
  48. LaneMax

    LaneMax

    Joined:
    Aug 12, 2013
    Posts:
    194
    Hmm there must be something we're missing, can you do a quick test and see if just a basic sphere with a SSS component sticks to the ragdoll? Just make a sphere with a rigidbody with a Sticky Stick Stuck component and drop it on the ragdoll at runtime to see if its sticks. Should be something like this, look at screenshot. And tell me if that sticks to the ragdoll or not.
     

    Attached Files:

  49. Setmaster

    Setmaster

    Joined:
    Sep 2, 2013
    Posts:
    239
    Sent you a private message.
     
  50. khpyun

    khpyun

    Joined:
    Feb 17, 2017
    Posts:
    1
    I have a question on your "Weapons FPS" example. I want to stick only "Stick Area" of the "Arrow Spawn" prefab, not the "Arrow" game object which is the child of the "Arrow Spawn" game object. How can I do it? I removed the mesh collider component of the "Arrow" game object. But it didn't work.