Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by markfm · Jan 03, 2013 at 10:11 PM · collidersinteractive cloth

Cannot attach collider to interactive cloth

So, long story short, Below is a piece of code that user to work perfectly, and has since stopped working.It is in relation to InteractiveCloth, the funny part is that I am unable to attach or remove colliders, yet any other setting works.

It is made as a grappling hook, the below code is attached to a GrappleHook. The Ontrigger enter happens when it hits the top. A ball ( for now) shoots this grapple hook and once it hits a target, the InteractiveCloth collider is attached to the the Ball.( I do not have it attached to start with because at start the attachment holds nearly all the vertices ( making the cloth a lot less flexible).

SecondHook, is the initial second holding point for the cloth.

To be honest im not sure if im even doing this whole grappling hook thing properly, however please see the commented lines below to understand the point of failure. The strange part is that this worked perfectly, prior to placing the rope and the grappling hook ( which this script is attached to) under the same prefab ( previously the rope was a prefab made up of the Grappling hook as parent, and rope as child.

 void OnTriggerEnter(Collider other) 
     { 
         
         rigidbody.isKinematic = true;
         transform.parent = other.transform;
         GameObject Ball = GameObject.Find("MainBall"); 
         Transform RopeTransform = FingerEventsSamplePart2.ropeTransform;
         print (RopeTransform);
         //NExt 2 lines do not work
         //RopeTransform.GetComponent<InteractiveCloth>().DetachFromCollider(SecondHook.collider);
         RopeTransform.GetComponent<InteractiveCloth>().AttachToCollider(Ball.collider,false,true);
         //Next line works perfectly.
         RopeTransform.GetComponent<InteractiveCloth>().stretchingStiffness = 0.9f;
         Destroy (SecondHook);        
     }

Really strange.. Can anyone guide me as to why this might be happening as im driving myself insane. I really appreciate any guidance.

Further Edit ----

I have attempted to move the script to the actual Ropeobject that has the Interactive cloth attached. Again I am unable to attach the ball.

The code below is attached to the rope object.

 public void AttachColliders ( Collider ColliderObject)
     {
         transform.GetComponent<InteractiveCloth>().AttachToCollider(ColliderObject,false,true);
     }

Comment
Add comment · Show 3
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 Bunny83 · Jan 03, 2013 at 10:59 PM 0
Share

Uhm, can you explain what "works perfectly" means and what exactly "stopped working"?

This piece of code isn't really helpful. A lot external references ($$anonymous$$ainBall, FingerEventsSamplePart2, SecondHook) and we have no idea to what object this script is attached nor do we know with which object this object should collide / intersect.

We don't have your project. We only see the letters you wrote up there... Please edit your question and add more details. Ask specific questions. What doesn't work? What does work? What should it do? What have you already tried?

avatar image markfm · Jan 03, 2013 at 11:03 PM 0
Share

Hi Bunny,

Thank you, I have edited it with more information.

avatar image markfm · Jan 04, 2013 at 01:17 AM 0
Share

Unity in realtion to cloths is acting unpredicatbley, i change something small and it goes crazy. I have never had any experience like this in my years in Unity. Really frustrating. I threw 12 hours away trying to attach a cloth to a sphere. Ridiculous

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

Problem with Interactive Clothing 1 Answer

physics.OverlapSphere colliders 1 Answer

Runner game collider 1 Answer

Ragdoll and Animator Collisions, 0 Answers

Is there a way to increase the max number of colliders in the ParticleSystem.trigger module? 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