Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jun 07, 2018 at 10:36 AM by gamer_2199 for the following reason:

Other

avatar image
0
Question by gamer_2199 · Dec 27, 2017 at 08:25 AM · unity 5physicsjoints

How do I create a chain connecting two objects?

I tried using different joints but it makes my objects go flying. I want tug of war like physics. Eg. A rope connecting two objects but instead of rope i want it to be a chain. I am new to game development :P.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NorthStar79 · Dec 27, 2017 at 09:34 AM 1
Share

does it need it to use physics? i mean, if you don't have to use physics just creating a line renderer and adjusting its points from code is enough sometimes. I usually avoid rope physics because they are heavy on CPU. also there are very good assets too if want to check asset store. i recommend obi rope for rope physics.

avatar image gamer_2199 NorthStar79 · Dec 27, 2017 at 09:54 AM 0
Share

yeah you are right I don't need physics. Can I use a quad, apply a material and then use any joints? I will check out line renderer too.

avatar image NorthStar79 gamer_2199 · Dec 27, 2017 at 10:45 AM 1
Share

let me few $$anonymous$$utes for creating a line renderer script i will post here when i done

Show more comments
avatar image Darkgaze · Sep 25, 2018 at 04:31 PM 0
Share

You can try our Obi Rope asset. It is way better than the official Unity rope. Have a look!. :-) http://obi.virtualmethodstudio.com/

3 Replies

  • Sort: 
avatar image
1

Answer by SergeiKu · Dec 27, 2017 at 10:07 AM

If you want create object like rope try to use Hingle Joint component. https://docs.unity3d.com/ru/530/Manual/class-HingeJoint.html or https://docs.unity3d.com/ru/530/Manual/class-HingeJoint2D.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BOB_KSE · Dec 27, 2017 at 10:49 AM 0
Share

yes yes hinge joint can be used. @gamer_2199

avatar image
1

Answer by NorthStar79 · Dec 27, 2017 at 11:10 AM

Hey, here a simple project that shows usage of line renderer.

you can modfy the code , add more points and simulate fake physics visuals too.

click here to download

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image NorthStar79 · Dec 27, 2017 at 11:16 AM 1
Share

please note that, rope texture is marked as repeat at import setting, and texture mode of line renderer is marked as tile. adding more points don't simulate fake physics alone you need to modify that points positions in your code. and use this as just an example. i did create this project just in 5 $$anonymous$$utes for you, so, there may be bugs, and performance errors. its not a complete rope system nor best practice example.

avatar image gamer_2199 · Dec 28, 2017 at 09:49 AM 0
Share

This is just like i need it to be but with a fixed length. Can you help with that? and yeah thanks a ton for this!!

avatar image NorthStar79 gamer_2199 · Dec 28, 2017 at 10:45 AM 0
Share

just move your handlers (the cubes in this expamle) with fixed distance between them. don't relly on physics (especially rope physics) because it will use much more CPU for nothing.

let me explain what i mean. lets say that Cube1 pulls the chain and drag cube2 with it. in this case you can move your cube one like this : // this is Cube$$anonymous$$ovement.cs attach this both cubes and uncheck interactable at one of them

 bool interactable = true; 
 
  // void Update()
 {
 if(Input.GetAxis("Horizontal") != 0 && interactable)
 {
 $$anonymous$$oveCubes(Input.GetAxis("Horizontal"));
 } 
 }
 
 void $$anonymous$$oveCubes(Float Speed)
 {
 gameObject.transform.Translate(new Vector3(0,0,Speed)*Time.deltaTime);
 otherGameObject.GetComponent<Cube$$anonymous$$ovement>().$$anonymous$$oveCubes(Speed);
 }

please note that i did not test this code yet.

avatar image gamer_2199 NorthStar79 · Dec 31, 2017 at 07:58 AM 0
Share

I will test this and get back to you!

Show more comments
avatar image
0

Answer by BOB_KSE · Dec 27, 2017 at 08:53 AM

I guess you want to create a linked list of elements.


Linked list is a dataStructure which consists of several nodes. These Nodes hold some data and also contain the address(location in ram) of the previous node.

google Linked List for more.


To know implement linked list in unity. click on This tutorial link.

& this fourm page also.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gamer_2199 · Dec 27, 2017 at 08:59 AM 0
Share

no no....i meant a metal chain ( like a rope ) connecting two objects. Let me edit my question

avatar image BOB_KSE gamer_2199 · Dec 27, 2017 at 10:41 AM 0
Share

in that case what @NorthStar79 suggested would be best.

even though you can implement some kind of rope physics using the linked list. where each node is a small unit of a chain or something & its position and physics are governed by the node behind it, but that would overcomplicate things.

avatar image gamer_2199 · Dec 27, 2017 at 10:53 AM 0
Share

yeah i am still learning basic things.

Follow this Question

Answers Answers and Comments

192 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to use Unity3D physics to make a robot hand move and grab an object? 1 Answer

Bend object with physics interaction 0 Answers

Collision work on pc emulator but not on android device 0 Answers

Excluding Vertices from Cloth Colliders in Unity 5 4 Answers

Hinge Joint Giving Fake 'Slack' 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges