Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  how to remove fixed state
#21
(14-02-2019, 12:47 PM)Richard Wrote: I want it be static.

I tried code, but many errors happen.


"Assets\InverseParticles.cs(15,33): error CS0029: Cannot implicitly convert type 'string' to 'UnityEngine.GameObject'"

"Assets\InverseParticles.cs(18,40): error CS1061: 'GameObject' does not contain a definition for 'invMasses' and no accessible extension method 'invMasses' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?)"

"Assets\InverseParticles.cs(20,44): error CS1061: 'GameObject' does not contain a definition for 'particleIndices' and no accessible extension method 'particleIndices' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?)"

"Assets\InverseParticles.cs(21,24): error CS1061: 'GameObject' does not contain a definition for 'invMasses' and no accessible extension method 'invMasses' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?)"

"Assets\InverseParticles.cs(21,39): error CS0103: The name 'solver' does not exist in the current context"


I can't solve the problem. I thought "actor" in your code is to get name of  object of mesh. However, string causes error. 
In addition to that, I cannot what to do for "solver", or am I wrong how to think the problems?


The code is the image.

Hi,

That code does not make sense at all.

- You're assigning a string to a variable of type GameObject. The name of an object is not the object itself.
- "actor" must be an ObiActor component, not a GameObject.
- "solver" must be declared somewhere in your script, and must be of type ObiSolver. You can make it a public variable and assign it in the inspector, or grab it from the actor itself.

Imho, before trying to use advanced stuff like cloth simulation, you should first study the elemental stuff: how to write C# and how to use Unity. I cannot hand-hold you trough such basic coding issues.

Here's some resources on the topic:
https://unity3d.com/es/learn/tutorials/s/scripting
Reply


Messages In This Thread
how to remove fixed state - by Richard - 14-02-2019, 02:43 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 08:11 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 08:38 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 08:52 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 09:12 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 09:19 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 10:04 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 10:28 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 10:32 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 10:51 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 11:14 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 11:21 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 11:25 AM
RE: how to remove fixed state - by Richard - 14-02-2019, 11:37 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 12:10 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 12:20 PM
RE: how to remove fixed state - by josemendez - 14-02-2019, 12:28 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 12:47 PM
RE: how to remove fixed state - by josemendez - 14-02-2019, 12:55 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 01:03 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 04:05 PM
RE: how to remove fixed state - by josemendez - 14-02-2019, 04:18 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 04:46 PM
RE: how to remove fixed state - by Richard - 14-02-2019, 10:58 AM
RE: how to remove fixed state - by josemendez - 14-02-2019, 11:04 AM