Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get particles in a group?
#9
maybe substep is the right option, i had to do this with unreal engine in the past to make it behave. how would i add force from another script in substep?

perhaps i need to explain what i am doing
i am attempting to create essentially a hover vehicle using raycast suspension. the raycast starts from a particle on each corner and applies upwards force to the corner particles.
the technique works fine with unity's rigid body but produces 'jiggle' on the softbody. it is fighting the external forces.

i copied the code from AddForce() but apply it to a single particle like this
Code:
body.solver.externalForces[particleindex] += suspensionForce / body.solver.invMasses[particleindex];
it is very close to working properly

edit:
this works. thanks for the help
Code:
void Actor_OnPreSolverStep(ObiActor actor, float stepTime)
    {
        actor.solver.externalForces[particleindex] += suspensionForce / actor.solver.invMasses[particleindex];
    }
Reply


Messages In This Thread
How to get particles in a group? - by tegleg - 14-03-2023, 01:07 PM
RE: How to get particles in a group? - by tegleg - 14-03-2023, 04:23 PM
RE: How to get particles in a group? - by tegleg - 14-03-2023, 06:01 PM
RE: How to get particles in a group? - by tegleg - 14-03-2023, 09:54 PM
RE: How to get particles in a group? - by tegleg - 15-03-2023, 01:01 PM