14-02-2019, 02:43 AM
Are there some ways to delete or remove all pin constraints and fixed state in the play or on script?
Help how to remove fixed state
|
14-02-2019, 02:43 AM
Are there some ways to delete or remove all pin constraints and fixed state in the play or on script?
14-02-2019, 08:11 AM
(This post was last modified: 14-02-2019, 08:11 AM by josemendez.)
(14-02-2019, 02:43 AM)Richard Wrote: Are there some ways to delete or remove all pin constraints and fixed state in the play or on script? Yes, select all fixed particles and click "unfix" button in the particle editor, or select all pinned particles and click "Remove selected" in the PinConstraints inspector.
14-02-2019, 08:38 AM
14-02-2019, 08:52 AM
(14-02-2019, 08:38 AM)Richard Wrote: Can I do that at runtime not using any buttons? Yes. Simply set the desired inverse mass values in case of fixed particles (0 for a fixed particle, any positive value for a non-fixed particle): http://obi.virtualmethodstudio.com/tutor...icles.html In case of pin constraints, just use the API to remove them: http://obi.virtualmethodstudio.com/tutor...aints.html (14-02-2019, 08:52 AM)josemendez Wrote: Yes. Simply set the desired inverse mass values in case of fixed particles (0 for a fixed particle, any positive value for a non-fixed particle): I copied code like the image and added. Some two errors happened."Assets\AddConstraints.cs(14,50): error CS0411: The type arguments for method 'Component.GetComponent<T>()' cannot be inferred from the usage. Try specifying the type arguments explicitly." and "Assets\AddConstraints.cs(15,76): error CS0021: Cannot apply indexing with [] to an expression of type 'IEnumerable<ObiConstraintBatch>'". How can I solve the errors. (14-02-2019, 09:12 AM)Richard Wrote: I copied code like the image and added. Some two errors happened."Assets\AddConstraints.cs(14,50): error CS0411: The type arguments for method 'Component.GetComponent<T>()' cannot be inferred from the usage. Try specifying the type arguments explicitly." and "Assets\AddConstraints.cs(15,76): error CS0021: Cannot apply indexing with [] to an expression of type 'IEnumerable<ObiConstraintBatch>'". How can I solve the errors.
14-02-2019, 09:19 AM
(14-02-2019, 09:12 AM)Richard Wrote: I copied code like the image and added. Some two errors happened."Assets\AddConstraints.cs(14,50): error CS0411: The type arguments for method 'Component.GetComponent<T>()' cannot be inferred from the usage. Try specifying the type arguments explicitly." and "Assets\AddConstraints.cs(15,76): error CS0021: Cannot apply indexing with [] to an expression of type 'IEnumerable<ObiConstraintBatch>'". How can I solve the errors. Hi, Sorry, the < and > signs weren't rendering properly in the page. We've corrected it. The code should be: Code: ObiDistanceConstraints constraints = GetComponent<ObiDistanceConstraints>();
14-02-2019, 10:04 AM
(14-02-2019, 09:19 AM)josemendez Wrote: Hi, If I use fix translation that is in edit particle, can I unfix that without any button at runtime?
14-02-2019, 10:28 AM
(This post was last modified: 14-02-2019, 10:28 AM by josemendez.)
(14-02-2019, 10:04 AM)Richard Wrote: If I use fix translation that is in edit particle, can I unfix that without any button at runtime? Yes. As I explained, set the desired inverse mass values in case of fixed particles (0 for a fixed particle, any positive value for a non-fixed particle). How to set per-particle properties is explained here: http://obi.virtualmethodstudio.com/tutor...icles.html
14-02-2019, 10:32 AM
(14-02-2019, 10:28 AM)josemendez Wrote: Yes. As I explained, set the desired inverse mass values in case of fixed particles (0 for a fixed particle, any positive value for a non-fixed particle). How to set per-particle properties is explained here:I tried the other way, but it did not work like the image. What is wrong?
14-02-2019, 10:51 AM
(This post was last modified: 14-02-2019, 10:52 AM by josemendez.)
(14-02-2019, 10:32 AM)Richard Wrote: I tried the other way, but it did not work like the image. What is wrong? Hi, What do you mean "the other way"? Honestly I don't know what your use case is, but adding that many pin constraints for a dress just doesn't make sense to me. Why'd you want to do that? Pin constraints are used to enable two-way coupling with rigidbodies... looks like you'd want to use either fixed particles or skin constraints, if you're trying to create character clothing. Also having a mesh collider for a deformable object doesn't make sense, specially when Obi has built-in collision detection for cloth. |
« Next Oldest | Next Newest »
|