I was trying to imitate the sample (With a VRoid Model) as practice, but after tinkering with the parameters for a few hours, I cant seem to get a normal result. All the vertices are jumping all over the place and some body parts dont move at all. I also tried to create a blueprint with the exact settings as the sample character without any luck.
Any idea what I am doing wrong?
Unity 2021.3.22f1
Latest Obi versions (updated two weeks ago)
There's an asset called RASCAL which automatically generates mesh colliders for characters, and also updates those at runtime when using blendshapes. So the mesh colliders change shape/size depending on the blendshape. Is it possible to use those colliders with your cloth system?
I tried to setup a shirt with a blueprint, but when I played the scene and then changed a blendshape slider on the body, the cloth didn't update. If I can't use mesh colliders, do you have another thought on how to handle blendshapes?
Thanks.
Im using Unity 2022.2.19 HDRP, and I'm getting this error in your scripts:
Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(34,13): error CS0305: Using the generic type 'UnsafeList<T>' requires 1 type arguments
Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(88,36): error CS8377: The type 'NativeMultilevelGrid<T>.Cell<T>' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'T' in the generic type or method 'NativeList<T>'
I have an attachment (static) that targets obi rigidbody which is child of my player.
When player moves in update, softbody jitters.
If my player moves in FixedUpdate() and Cinemachine Brain is set to FixedUpdate, there is no jitter, but the problem is that I can't use this setup (it breaks other stuff).
Is there a way to move attachment's target in Update() without causing softbody to jitter?
If I move target in editor (with gizmos), it seem that softbody is not jittering. Same, if I unparent target and move it by code.
It seems that the problem is in parent-child relation, but I can't figure it out.
If I just unparent target and move it to desired point (which is child of player) by setting Transform properties, or even by moving target's rigidbody (with interpolation or not) by rigidbody.MovePosition/MoveRotation, the jitter is there.
Same if I remove obi rigidbody and rigidbody from target.
No jittering when using Obi Late Updater, but simulation differs with different framerates, so I can't use it too
I am changing rope length in OnBlueprintLoaded callback. This works well in Editor, but in build I get
NullReferenceException in ObiRopeCursor script, line 131
Code:
NullReferenceException: Object reference not set to an instance of an object
at Obi.ObiRopeCursor.ChangeLength (System.Single newLength) [0x00001]
in C:\myProject\Assets\Obi\Scripts\RopeAndRod\Actors\ObiRopeCursor.cs:131
I guess that the rope reference in cursor is somehow null. How can this happen if it worked fine in Editor?
So I have one issue with my setup (check the attached video).
I am giving control inputs to all 4 ropes, with speed = 2 and time_dt = 0.01 with which I am controlling the ropes.
However as can be seen in the video, the attached object is falling slowly while the ropes are getting extending fast, creating an undesirable result.
I changed the speed to 1, which gives somewhat desirable output, but then the movement of the attached object is slow.
What I want is to move the object a bit faster but at the same time, the rope should also extend accordingly.
I'm trying to develop a simulation of a ship mooring line breaking and snapping back. So far I've been able to get the rope to tear at one end programmatically, and it looks pretty good, but there are a few problems I'd like to solve:
1. How does one increase the speed the rope flings back after being broken? I would assume it's tied to the tension, but I'm not 100% sure how to increase the tension without shrinking the rope (see below), which is what I saw suggested on another forum post here. Ideally I'd like a different way of doing this.
2. After breaking the rope, it seemingly gets a lot smaller than its original size. See the images attached. In the custom script I wrote, I use a Cursor to reduce the size of the rope at the start so that the tension is increased. However, after breaking, it seems to get much smaller than what I set it to. Ideally I would like the rope to maintain its original length after being broken, so it could fling back and potentially reach its full length in the opposite direction.
Here's my very simple code so far:
Code:
public class TensionScript : MonoBehaviour
{
public Transform attachmentA;
public Transform attachmentB;
public float timeScale;
public bool reduceLength;
public float length;
ObiRope rope;
The rope only has two control points, one at each end.
All the bend and distance constraint options are set to 0. I believe this makes the rope as rigid as I want it, but let me know if I should change anything here.
Both ends have an ObiParticleAttachment on them.
After breaking, the rope swings around the bollard seemingly indefinitely, even though I have a dampening value set on the solver. Not sure what causes this.
Hopefully you understand my issue and what I would like to achieve here.
I am trying to use obi softbody and obi ropes together but the mesh is getting weird. Basically I have a chain attached to a stand gameObjet and a punchingBag gameObject, this setup working fine but whenever I add softbody component to the punchingBag it either starts moving on it's own weirdly or it becomes a puddle of mesh and fals into the ground.
I'm currently working on a game where we want to have wiggly boobs for the character. The problem seems to be that the connection between the vertices I select by script and the particles I get at the and aren't working well.
My approach is the following: like if I would create the blueprint by hand I selected certain vertices that are connected to the bones of the boobs. Then I invert the selected particles and use the RemoveSelectedParticles method with the optimize to true.
The remaining selected particles I then use for the "chest" group which will be attaches to the body so they don't wiggle/move. Sadly the results aren't working well. There is particles that still wiggle even they they should be part of the body and others which are part of the boobs don't move at all.
Maybe you can also help me that I might be able to create the particles on my own and place particles based on the vertices I have:
This screenshot shows the particles that are created: [attachment=1726]
This screenshot shows the vertices that I have from the bones:
This is the vertices that have been found in the vertexToParticles list after all the optimization etc.
[attachment=1728]
Here is the code I'm using:
Code:
using System.Collections;
using UnityEngine;
using Obi;
using ExternalPropertyAttributes;
using System;
using CurvedUI;
using System.Collections.Generic;
using System.Linq;
public class BoobsInteraction : MonoBehaviour
{
[System.Serializable]
public class BonesWithWeights
{
public string BoneName;
public float WeightThreshold;
}
public Transform UpperChest;
public SkinnedMeshRenderer BodyRenderer;
public List<SkinnedMeshRenderer> AdditionalRenderers = new List<SkinnedMeshRenderer>();
public ObiSoftbody SofbodyPrefab;
public float DefaultBoobsHeight = 1.13f;
public List<BonesWithWeights> bonesThresholds = new List<BonesWithWeights>()
{
new BonesWithWeights() { BoneName = "Bust1", WeightThreshold = 0.75f},
new BonesWithWeights() { BoneName = "Bust2", WeightThreshold = 0.0f }
};
private ObiParticleAttachment _attachment;
private struct BoneWithThreshold {
public int BoneIndex;
public float Threshold;
}
[Button]
public void Initialize()
{
if (UpperChest == null) throw new ArgumentNullException($"Property {nameof(UpperChest)} is not set");
if (BodyRenderer == null) throw new ArgumentNullException($"Property {nameof(BodyRenderer)} is not set");
if (SofbodyPrefab == null) throw new ArgumentNullException($"Property {nameof(SofbodyPrefab)} is not set");