07-03-2019, 10:20 AM
Hello.
I want to make if statement when the cloth is tore. How can I do that?
I want to make if statement when the cloth is tore. How can I do that?
Help get sign when cloth is tore
|
07-03-2019, 10:20 AM
Hello.
I want to make if statement when the cloth is tore. How can I do that?
07-03-2019, 11:05 AM
(07-03-2019, 10:20 AM)Richard Wrote: Hello. Hi, You could constantly poll for a difference in used particles, but that's not very efficient. Using an event is much better. I've modified ObiTearableCloth.cs to include an event callback when the cloth is torn, please find it attached. This event is passed the constraint and particle indices involved in the tear event by parameter. Here's a usage example: this script subscribes to the callback event, and spawns a GameObject at the position of each torn particle. Code: using System.Collections;
07-03-2019, 12:27 PM
(07-03-2019, 11:05 AM)josemendez Wrote: Hi, An error is displayed when I download the code. Assets\ObiTearableCloth.cs(81,23): error CS0115: 'ObiTearableCloth.OnSolverStepEnd(float)': no suitable method found to override How can I fix this?
07-03-2019, 12:39 PM
(This post was last modified: 07-03-2019, 12:39 PM by josemendez.)
(07-03-2019, 12:27 PM)Richard Wrote: An error is displayed when I download the code. Sorry, I wrote this modification on top of v4.0.3. For earlier versions simply remove the float argument from the function definition on ObiTearableCloth.cs. I attached the new file with this slight change.
07-03-2019, 01:10 PM
(07-03-2019, 12:39 PM)josemendez Wrote: Sorry, I wrote this modification on top of v4.0.3. For earlier versions simply remove the float argument from the function definition on ObiTearableCloth.cs. I attached the new file with this slight change. New error happened... Assets\Obi\Editor\ObiTearableClothEditor.cs(28,23): error CS0433: The type 'ObiTearableCloth' exists in both 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Obi, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Assets\Obi\Editor\ObiTearableClothEditor.cs(61,3): error CS0433: The type 'ObiTearableCloth' exists in both 'Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Obi, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
07-03-2019, 01:48 PM
(07-03-2019, 01:10 PM)Richard Wrote: New error happened... That means you haven't replaced the existing file, but duplicated it. Please replace the existing ObiTearableCloth.cs file with the provided one.
07-03-2019, 02:11 PM
07-03-2019, 02:13 PM
07-03-2019, 02:34 PM
(07-03-2019, 02:13 PM)josemendez Wrote: Yes, its icon is an orange flag. It is found in Obi/Scripts/Actors/ObiTearableCloth.cs I cannot find out what is wrong, but here is an error.
07-03-2019, 02:49 PM
(This post was last modified: 07-03-2019, 02:55 PM by josemendez.)
(07-03-2019, 02:34 PM)Richard Wrote: I cannot find out what is wrong, but here is an error. There should not be a file named "ObiTearableCloth (1)". It should be "ObiTearableCloth". Again, look trough your project for copies of this file and remove them, since the name "ObiTearableCloth (1)" indicates you have created a copy of the file, instead of replacing the original one. There should be only one file named ObiTearableCloth.cs, located at Obi/Scripts/Actors/ObiTearableCloth.cs |
« Next Oldest | Next Newest »
|