15-04-2024, 12:38 PM
(15-04-2024, 12:05 PM)josemendez Wrote: Hi!
Have you checked whether they actually do have a filter?
How are you creating and spawning these smaller softbodies? Could you share your code for this?
Code:
public void Spawn(JellyObject prefab, Vector3 position, Quaternion rotation, Action<JellyObject> OnSpawn = null)
{
instances++;
int id = instances;
//solver.OnEndStep += SpawnJelly;
solver.OnPrepareFrame += SpawnJelly;
void SpawnJelly(ObiSolver solver)
{
solver.OnPrepareFrame -= SpawnJelly;
JellyObject jelly = Instantiate(prefab, position, rotation);
jelly.transform.SetParent(jellyParent);
spawnedObjects.Add(jelly);
SetRandomColor(jelly);
jelly.spawnID = id;
if (jelly.Softbody)
{
//solver.AddActor(jelly.actor);
}
OnSpawn?.Invoke(jelly);
}
}