Latest Threads |
can you remove particles ...
Forum: Obi Softbody
Last Post: aardworm
09-07-2025, 07:09 AM
» Replies: 0
» Views: 103
|
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 11:27 AM
» Replies: 4
» Views: 382
|
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 06:34 AM
» Replies: 6
» Views: 524
|
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 1,254
|
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 349
|
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 431
|
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 1,194
|
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 417
|
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 245
|
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 5,508
|
|
|
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)?
|
|
|
|