Latest Threads |
Stretching verts uniforml...
Forum: Obi Softbody
Last Post: Aroosh
Yesterday, 05:32 AM
» Replies: 0
» Views: 69
|
Scripting rod forces
Forum: Obi Rope
Last Post: chenji
11-09-2025, 01:15 PM
» Replies: 25
» Views: 2,773
|
Burst error causing crash...
Forum: Obi Rope
Last Post: josemendez
10-09-2025, 07:03 AM
» Replies: 1
» Views: 189
|
Controlling speed of emit...
Forum: Obi Fluid
Last Post: josemendez
06-09-2025, 06:29 AM
» Replies: 1
» Views: 438
|
Looks nice on editor but ...
Forum: Obi Fluid
Last Post: josemendez
04-09-2025, 07:20 AM
» Replies: 3
» Views: 690
|
How to Shorten or Scale t...
Forum: Obi Rope
Last Post: josemendez
02-09-2025, 09:53 AM
» Replies: 5
» Views: 779
|
The Limitation of Using O...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 10:30 PM
» Replies: 1
» Views: 518
|
Bug Where a Straight Segm...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 08:46 PM
» Replies: 1
» Views: 491
|
Having an issue with obi ...
Forum: Obi Rope
Last Post: Ben_bionic
29-08-2025, 04:23 PM
» Replies: 4
» Views: 989
|
Non-uniform particle dist...
Forum: Obi Rope
Last Post: chenji
29-08-2025, 09:05 AM
» Replies: 4
» Views: 835
|
|
|
Obi fluid collision |
Posted by: JskT01 - 06-03-2021, 02:51 AM - Forum: Obi Fluid
- Replies (9)
|
 |
I have a container with liquid which I move, I want it to do something when it spills and collides with the floor, I am using an event to check when it collides with the floor, but the performance when using this script drops from 50 fps to 17fps what I could do ?
Code: void Awake()
{
solver = GetComponent<Obi.ObiSolver>();
}
void OnEnable()
{
solver.OnCollision += Solver_OnCollision;
}
void OnDisable()
{
solver.OnCollision -= Solver_OnCollision;
}
void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
{
var world = ObiColliderWorld.GetInstance();
foreach (Oni.Contact contact in e.contacts)
{
// this one is an actual collision:
if (contact.distance < 0.01)
{
ObiColliderBase collider = world.colliderHandles[contact.other].owner;
if (collider.name!="Piso")
{
Debug.Log(collider.name);
solver.OnCollision -= Solver_OnCollision;
// do something with the collider.
}
}
}
}
|
|
|
How to drag a rope from any point of the rope |
Posted by: wakin001 - 05-03-2021, 04:45 PM - Forum: Obi Rope
- Replies (2)
|
 |
I created a rope, and when I touch the rope and need to drag it from the touch point.
I can get the touch point on the rope, but how can I drag it?
I added an ObiParticleAttachment on the ObiRope, and I try to find the control point near my touch point, but I found all control points are the same and will never change, after changing the position of the rope.
So can I find the correct control point in runtime?
|
|
|
Attaching a prefab to each particle in a rope. |
Posted by: hecali_aj - 05-03-2021, 11:29 AM - Forum: Obi Rope
- Replies (2)
|
 |
Hello,
Is there a way to attach a gameobject/prefab to rope particles? I was thinking of creating the rope through script and attaching a prefab to each particle in the rope.
Is there a better way to do this? Is using pin constraints the solution to this one?
|
|
|
IndexOutOfRange in ClothProxy on Android |
Posted by: JanikH - 04-03-2021, 03:53 PM - Forum: Obi Cloth
- Replies (3)
|
 |
Hi,
when running our game on Android we're currently running into the following exception:
Code: IndexOutOfRangeException: Index was outside the bounds of the array.
at Obi.ObiClothProxy.UpdateSkinning (Obi.ObiActor actor) [0x002ab] in ...\Assets\Obi\Scripts\Cloth\Rendering\ObiClothProxy.cs:132
at Obi.ObiClothRendererBase.UpdateRenderer (Obi.ObiActor actor) [0x0012b] in ...\Assets\Obi\Scripts\Cloth\Rendering\ObiClothRendererBase.cs:191
at Obi.ObiActor.Interpolate () [0x0010d] in ...\Assets\Obi\Scripts\Common\Actors\ObiActor.cs:1189
at Obi.ObiSolver.Interpolate (System.Single stepTime, System.Single unsimulatedTime) [0x000a7] in ...\Assets\Obi\Scripts\Common\Solver\ObiSolver.cs:1622
at Obi.ObiUpdater.Interpolate (System.Single stepDeltaTime, System.Single accumulatedTime) [0x0002f] in ...\Assets\Obi\Scripts\Common\Updaters\ObiUpdater.cs:110
at Obi.ObiFixedUpdater.Update () [0x00007] in ...\Assets\Obi\Scripts\Common\Updaters\ObiFixedUpdater.cs:62
This does not occur when running in the editor.
We're using ObiCloth 6.0.1 with Unity 2020.2.4f1.
I made sure to regenerate the blueprint and rebind the skin map.
Any pointers as to what the issue may be?
|
|
|
Adding & Removing ObiParticleAttachments at runtime |
Posted by: MartinBischoff - 04-03-2021, 03:20 PM - Forum: General
- Replies (1)
|
 |
I want to dynamically add and remove ObiParticleAttachments to individual particles of Softbodies at runtime.
My current implemenation looks like this:
Code: private void Grasp(ObiActor actor, int index)
{
attachment = actor.gameObject.AddComponent<ObiParticleAttachment>();
attachment.target = transform;
attachment.particleGroup = actor.blueprint.AppendNewParticleGroup(groupName);
groupIndex = actor.blueprint.groups.Count;
attachment.particleGroup.particleIndices = new List<int> { index };
attachment.compliance = 0;
attachment.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
IsGrasping = true;
solver.RemoveActor(actor);
solver.AddActor(actor);
}
private void Release()
{
Destroy(attachment);
actor.blueprint.RemoveParticleGroupAt(groupIndex);
solver.RemoveActor(actor);
solver.AddActor(actor);
}
I can succesfully preform Grasp() and Release() once. The second time I call Grasp() the actor moves only halfway to the attachments target. It seems like the solver did not fully forget the previous attachments.
I experimented several hours with the methods suggested in Scripting Constraints tutorial without success.
I don't want to add forces to particles in this script as it is done in ObiParticleDragger but rather activate & deactivate a pin/attachment constraint.
Thank you so much for your support!
tl/dr:
How do I properly register and unregister ObiParticleAttachments at runtime?
|
|
|
|