Latest Threads |
Stretching verts uniforml...
Forum: Obi Softbody
Last Post: Aroosh
Today, 05:32 AM
» Replies: 0
» Views: 61
|
Scripting rod forces
Forum: Obi Rope
Last Post: chenji
11-09-2025, 01:15 PM
» Replies: 25
» Views: 2,552
|
Burst error causing crash...
Forum: Obi Rope
Last Post: josemendez
10-09-2025, 07:03 AM
» Replies: 1
» Views: 167
|
Controlling speed of emit...
Forum: Obi Fluid
Last Post: josemendez
06-09-2025, 06:29 AM
» Replies: 1
» Views: 417
|
Looks nice on editor but ...
Forum: Obi Fluid
Last Post: josemendez
04-09-2025, 07:20 AM
» Replies: 3
» Views: 670
|
How to Shorten or Scale t...
Forum: Obi Rope
Last Post: josemendez
02-09-2025, 09:53 AM
» Replies: 5
» Views: 761
|
The Limitation of Using O...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 10:30 PM
» Replies: 1
» Views: 506
|
Bug Where a Straight Segm...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 08:46 PM
» Replies: 1
» Views: 480
|
Having an issue with obi ...
Forum: Obi Rope
Last Post: Ben_bionic
29-08-2025, 04:23 PM
» Replies: 4
» Views: 973
|
Non-uniform particle dist...
Forum: Obi Rope
Last Post: chenji
29-08-2025, 09:05 AM
» Replies: 4
» Views: 825
|
|
|
Copy position from one rope to another |
Posted by: lufydad - 13-01-2022, 10:33 AM - Forum: Obi Rope
- Replies (12)
|
 |
Hello,
I have two ropes 0 and 1. The rope 0 is physically managed by the obi solver, and I would like the rope 1 to be only a copy of the rendering of the first one.
To do this, I tried to get all the positions of the rope 0 and I applied them to the rope 1 (see code below).
Code: public void LateUpdate()
{
for (int i = 0; i < _obiRope0.solverIndices.Length; i++)
{
var indexParticles = _obiRope0.solverIndices.SolverIndices[i];
if (_obiRope0.IsParticleActive(indexParticles) == false)
continue;
_obiSolver0.positions[indexParticles] = _obiSolver1.positions[indexParticles];
}
}
However, there are two problems with this solution:
- In the rendering there is a regular teleportation of the rope 1 to its "physical position".
- In terms of performance, physical calculations are still done for the rope 1.
How should the obi solver for the rope 1 be set up to solve the two points above ? Or is there another way to achieve this goal ?
Thanks,
|
|
|
Can fluids collide with other OBI assets? |
Posted by: tecnnt - 12-01-2022, 05:27 PM - Forum: Obi Fluid
- Replies (4)
|
 |
Can fluids collide with other OBI assets?
What I most want to know is the application of fluid and cloth, does it require additional coding to achieve it?
How to achieve this? I tried 2 hours of trying according to the docs and found that no matter what, the fluid goes through the cloth
Translate from Google
|
|
|
extanding the rope from its end towards a diractino using the RopeCurser |
Posted by: almog1752 - 11-01-2022, 03:30 AM - Forum: Obi Rope
- Replies (8)
|
 |
sorry for the long messy code, ive been trying to make a rope that shoot form the place i want towards a diraction and connects both ends for the last couple of days and i had alot of problems but the main one i have now and cant solve is i cant get the rope curses to extend the way i want it to,here my code:
using System.Collections.Generic;
using UnityEngine;
using Obi;
public class ChainPowerUpVersion3_ObiRope : PowerUpConstructor
{
//public override int UsegeNumber { get{return 2;} }
public GameObject ExpusedOutfit;
public override GameObject Outfit { get { return ExpusedOutfit; } }
bool tryToTurnOff = false;
PowerUpHandeler HandlerIns;
public List<string> objectsToTurnOff;
public override List<string> ObjectToTurnOf { get { return objectsToTurnOff; } }
public float MaxShotDst = 20f;
public GameObject ObiRopeSolver;
public bool AtchObject = false;
float timeC = 0;
bool ShotRope = false;
public float ShotingSpeed = 30f;
float length = 0;
ObiSolver SolverComponent;
public List<int> indexList = new List<int>();
public ObiRope rope;
public ObiActor actor;
public GameObject Player;
public ObiRopeCursor RopeCurser;
Vector3 RopeTarget;
public GameObject SolverObject;
private void Update()
{
if (ShotRope)
{
//set velocity to zero
for (int i = 0; i < actor.activeParticleCount; ++i)
{
SolverComponent.velocities[actor.solverIndices[i]] = Vector3.zero;
}
//extandrope
int solverIndex = actor.solverIndices[actor.activeParticleCount - 1];
Vector3 LastPoint = SolverComponent.positions[solverIndex];
if (Vector3.Distance(LastPoint, RopeTarget) > 0.1f)
{
int solverIndex2 = actor.solverIndices[actor.activeParticleCount - 2];
Vector3 SecoundLastPoint = SolverComponent.positions[solverIndex2];
float dis = Vector3.Distance(LastPoint, SecoundLastPoint);
Vector3 WorldPos = SolverObject.transform.TransformPoint(SecoundLastPoint);
SolverComponent.positions[solverIndex] = SolverObject.transform.
InverseTransformPoint(WorldPos + (RopeTarget - WorldPos).normalized * (dis));
length += ShotingSpeed * Time.deltaTime;
RopeCurser.ChangeLength(length);
}
else
{
ShotRope = false;
SolverComponent.gravity = Vector3.down * 9.81f;
}
}
}
public override void ActivatePowerUp(GameObject player, Vector3 AimVector)
{
Player = player;
RaycastHit hit;
if (Physics.Raycast(player.transform.position, AimVector, out hit, 20f))
{
Vector3 StartPos = player.transform.position + player.transform.forward * 0.3f;
SolverObject = Instantiate(ObiRopeSolver, Vector3.zero, Quaternion.identity);
rope = SolverObject.transform.GetChild(0).GetComponent<ObiRope>();
SolverComponent = SolverObject.GetComponent<ObiSolver>();
actor = SolverComponent.actors[0];
SolverComponent.gravity = Vector3.zero;
RopeTarget = hit.point;
for (int i = 0; i < actor.activeParticleCount; ++i)
{
int solverIndex = actor.solverIndices[i];
indexList.Add(solverIndex);
}
SolverComponent.positions[indexList[0]] = SolverObject.transform.
InverseTransformPoint(player.transform.position + player.transform.forward * 0.3f);
SolverComponent.positions[indexList[indexList.Count - 1]] = SolverObject.transform.
InverseTransformPoint(player.transform.position + player.transform.forward * 0.4f);
RopeCurser = SolverComponent.GetComponentInChildren<ObiRopeCursor>();
ObiParticleAttachment atch = rope.gameObject.AddComponent<ObiParticleAttachment>();
ObiParticleGroup particalGroup = rope.ropeBlueprint.groups[0];
//ObiParticleGroup particalGroup = actor.blueprint.AppendNewParticleGroup("End Point");
atch.particleGroup = particalGroup;
atch.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
atch.target = Player.transform.GetChild(1).transform;
ShotRope = true;
}
}
}
|
|
|
[BUG] IndexOutOfRangeException: Index was outside the bounds of the array |
Posted by: Svyatoslav - 10-01-2022, 07:57 PM - Forum: Obi Softbody
- Replies (3)
|
 |
Why is this happening? How to fix it? The project is completely clean.
https://youtu.be/TWCbnxFDqfw
(2:15)
Obi Softbody 6.3
Unity3D 2021.2.7f1 (last), 2021.1.13f1, 2020.3.25f1 (LTS)
Windows 10 license
Error text:
IndexOutOfRangeException: Index was outside the bounds of the array.
Obi.ObiSoftbodySurfaceBlueprintEditor.VertexToParticle (System.Int32 vertexIndex) (at Assets/Obi/Editor/Softbody/Blueprints/ObiSoftbodySurfaceBlueprintEditor.cs:217)
Obi.ObiMeshBasedActorBlueprintEditor.DrawGradientMesh (System.Single[] vertexWeights, System.Single[] wireframeWeights) (at Assets/Obi/Editor/Common/Blueprints/ObiMeshBasedActorBlueprintEditor.cs:123)
Obi.ObiBlueprintRenderModeMesh.OnSceneRepaint (UnityEditor.SceneView sceneView) (at Assets/Obi/Editor/Common/Blueprints/RenderModes/ObiBlueprintRenderModeMesh.cs:43)
Obi.ObiActorBlueprintEditor.OnSceneGUI (UnityEditor.SceneView sceneView) (at Assets/Obi/Editor/Common/Blueprints/ObiActorBlueprintEditor.cs:322)
UnityEditor.SceneView.CallOnSceneGUI () (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEditor.SceneView.DoOnGUI () (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEditor.SceneView.OnSceneGUI () (at <0cde216a590a4d6fbc3d7db7ac203c5d>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <66054a7773f64b399021c1a3f19995a3>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <66054a7773f64b399021c1a3f19995a3>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <4c1b5f56ab12481abc458fdd69da0f26>:0)
|
|
|
gravity does not apply when I manually set the fixed delta time |
Posted by: lufydad - 10-01-2022, 11:17 AM - Forum: Obi Rope
- Replies (9)
|
 |
Hello,
When I set the fixed delta time from script to 1/60 in an empty scene with just a rope, the rope just stay still, the gravity does not seem to apply on it. If I change the fixed delta time to another value the rope falls down normally.
I use Obi 6.2, Unity 2021.2.4f, and DX11.
Is there something that I can do to fixed this ?
|
|
|
How to define particle orientation? |
Posted by: Romahaaa - 10-01-2022, 09:50 AM - Forum: Obi Rope
- Replies (1)
|
 |
Hi,
I am trying to implement ObiRope to reach such effect.
The rope is attached to Object A (draggable) from the top and to Object B (just a rigidbody object) from the bottom. At some point I need to spawn the elements on the rope and attach them but it's not enough just to know the position of particle (the point on the rope blueprint) but also need to know it's orientation/normal to spawn these objects in a correct rotation.
I found some topics here that OBiRope particles doesn't have rotation. Is there any workaround how can I implement this? If it's not possible, maybe there is a way to attach these spawned elements while the rope is in the static state (in this case I may define required rotation referring to Object A rotation)?
|
|
|
Circular rope? |
Posted by: ECoins - 09-01-2022, 04:36 PM - Forum: Obi Rope
- Replies (2)
|
 |
Hi Jose,
I'm wondering what is the best way to create a rope that is circular. As the path edit tool isn't too accurate when used in the editor, I attempted to do this in code/runtime with the below, I've just taken out parts relevant to the co-ordinates of the points. The result is a square with rounded corners aha. Any assistance would be appreciated.
Code: var p0 = new Vector3(0, 0, -1);
var p1 = new Vector3(1, 0, 0);
var p2 = new Vector3(0, 0, 1);
var p3 = new Vector3(-1, 0, 0);
bluePrint.path.AddControlPoint(p0, new Vector3(-1, 0, 0), new Vector3(1, 0, 0), Vector3.up, 0.1f, 0.1f, 1, 1, Color.yellow, "p0");
bluePrint.path.AddControlPoint(p1, new Vector3(0, 0, -1), new Vector3(0, 0, 1), Vector3.up, 0.1f, 0.1f, 1, 1, Color.yellow, "p1");
bluePrint.path.AddControlPoint(p2, new Vector3(1, 0, 0), new Vector3(-1, 0, 0), Vector3.up, 0.1f, 0.1f, 1, 1, Color.yellow, "p2");
bluePrint.path.AddControlPoint(p3, new Vector3(0, 0, 1), new Vector3(0, 0, -1), Vector3.up, 0.1f, 0.1f, 1, 1, Color.yellow, "p3");
|
|
|
|