Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Cloth does not simulate when unfixed during runtime.
#2
(07-10-2019, 08:15 AM)3rdcat Wrote: Hi, I'm trying to experiment with unfixing cloth during runtime.
I'm using a raycast to trigger the unfixing, however when the cloth is hit, the particles do become unfixed but the cloth does not respond to gravity/wind/anything.

Attached is the script I am using to test it.
Stuff in comments was me trying to force active on the particles just to see if it would do anything (it didn't unfortunately).

Please do help assist.



Thank you very much.

Hi there,

You're just changing the actor's data (which is the data serialized with the actor, copied over to the solver when you press "play"), but not solver data. While you can read data from actor.invMasses/positions/velocities/whatever to retrieve rest-pose values, writing to them does not have any effect at runtime. You need to set solver.invMasses instead. Also no need to call UpdateActiveParticles(), as you're not activating/deactivating particles, just setting their mass. Take a look at:

http://obi.virtualmethodstudio.com/tutor...icles.html
Reply


Messages In This Thread
RE: Cloth does not simulate when unfixed during runtime. - by josemendez - 07-10-2019, 09:23 AM