Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiple softbodys not interacting
#1
I need to have multiple soft bodys each being influenced by different forces, yet still collide with each other.

my questions is can i have 2 unique Soft body solvers colliding with each other?

I have 4 softbodys in one solver...being influenced by 1 force
i have 3 softbodys in another solver being influenced by another force.
is there a solution for making them collide? 

many thanks.
Reply
#2
(17-12-2019, 01:12 PM)Duncano Wrote: I need to have multiple soft bodys each being influenced by different forces, yet still collide with each other.

my questions is can i have 2 unique Soft body solvers colliding with each other?

I have 4 softbodys in one solver...being influenced by 1 force
i have 3 softbodys in another solver being influenced by another force.
is there a solution for making them collide? 

many thanks.

Actors in different solvers cannot interact with each other. How about using softbody.AddForce() instead of force zones?
Reply
#3
(17-12-2019, 01:48 PM)josemendez Wrote: Actors in different solvers cannot interact with each other. How about using softbody.AddForce() instead of force zones?

is there a script for this?, i cant seem to find how to apply this softbody.Addforce? ( forgive my rubbishness...i know nothing of scripting)

loving the product by the way, its pretty incredible
this is what im fiddling with...i just want to have some cells that dont get attracted the same force.

https://vimeo.com/379996728/7187a632e3
Reply
#4
(17-12-2019, 02:10 PM)Duncano Wrote: is there a script for this?, i cant seem to find how to apply this softbody.Addforce? ( forgive my rubbishness...i know nothing of scripting)

loving the product by the way, its pretty incredible
this is what im fiddling with...i just want to have some cells that dont get attracted the same force.

https://vimeo.com/379996728/7187a632e3

AddForce is a function you can call on a softbody. So, just write a script that calls it:

Code:
using Obi;

public class Force
{

public ObiSoftbody softbody;

void FixedUpdate()
{
softbody.AddForce(<your force here>);
}
}
Reply
#5
(17-12-2019, 02:25 PM)josemendez Wrote: AddForce is a function you can call on a softbody. So, just write a script that calls it:

Code:
using Obi;

public class Force
{

public ObiSoftbody softbody;

void FixedUpdate()
{
softbody.AddForce(<your force here>);
}
}
thanks very much, easy if you know how...unfortunately  i dont know how....my scripting knowledge is based on using other peoples scripts and adapting what i can...i tried doing something with the code above, no luck. If such a script already exists, i would be grateful if i could just drag it on to the objects i want to move.
Reply
#6
(17-12-2019, 04:03 PM)Duncano Wrote: thanks very much, easy if you know how...unfortunately  i dont know how....my scripting knowledge is based on using other peoples scripts and adapting what i can...i tried doing something with the code above, no luck. If such a script already exists, i would be grateful if i could just drag it on to the objects i want to move.

Hi,

Simply create a new C#, copy and paste the code above. Replace the "<your force here>" with the force you want to apply, that's it. Here's the full copy-pastable code, made the force a public variable for convenience, so that you can change it in the editor:

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;

public class Force : MonoBehaviour
{
   public ObiSoftbody softbody;
   public Vector3 force;

   public void FixedUpdate()
   {
       softbody.AddForce(force,ForceMode.Force);
   }
}

If you're aiming to develop games (or any program for that matter), learning how to code is a must, or at the very least having a programmer in the team who can do the job. You just can't rely on copy-pasting code you don't fully understand.
Reply
#7
(17-12-2019, 04:21 PM)josemendez Wrote: Hi,

Simply create a new C#, copy and paste the code above. Replace the "<your force here>" with the force you want to apply, that's it. Here's the full copy-pastable code, made the force a public variable for convenience, so that you can change it in the editor:

Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;

public class Force : MonoBehaviour
{
   public ObiSoftbody softbody;
   public Vector3 force;

   public void FixedUpdate()
   {
       softbody.AddForce(force,ForceMode.Force);
   }
}

If you're aiming to develop games (or any program for that matter), learning how to code is a must, or at the very least having a programmer in the team who can do the job. You just can't rely on copy-pasting code you don't fully understand.
thanks for your help ( no luck getting my object to move yet, but will keep going), my aim is not to develop games,  mostly prototyping ( PlayMaker), Im a 3DS max artist ( motion design) of many years, and seeing the quality of what can be achieved in realtime is bringing me more and more to Unity....and the joys of zero rendering time and expense. thanks again.
Reply
#8
(17-12-2019, 04:51 PM)Duncano Wrote: thanks for your help ( no luck getting my object to move yet, but will keep going), my aim is not to develop games,  mostly prototyping ( PlayMaker), Im a 3DS max artist ( motion design) of many years, and seeing the quality of what can be achieved in realtime is bringing me more and more to Unity....and the joys of zero rendering time and expense. thanks again.

No worries! over time you'll find however that using Unity without a bit of scripting knowledge feels quite limiting. Cool things can be done with the built-in components, though.

Regarding the object/force, keep in mind that the effect of force depends on the mass of the object receiving it. Depending on the mass of your particles you might need to crank up the force quite high for it to have an effect.
Reply
#9
(17-12-2019, 05:02 PM)josemendez Wrote: No worries! over time you'll find however that using Unity without a bit of scripting knowledge feels quite limiting. Cool things can be done with the built-in components, though.

Regarding the object/force, keep in mind that the effect of force depends on the mass of the object receiving it. Depending on the mass of your particles you might need to crank up the force quite high for it to have an effect.

awesome! cranked it up, and we have lift off! loving it!
Reply