Hi there,
I have an issue in that I have ropes attached to the player and all is well, however, at a certain point in the game I boost the player's speed. At this point a Particle Attachment Group is not rendering in step with the target.
How can I boost the speed of the group, tracking the target?
Is there a way to obtain the coordinates of each vertex after the deformation of an object?
How can I extract vertex coordinates and mesh information in the work coordinate system after the original vertices have been deformed? (I want to know where the original vertices have moved to after the deformation.)
Is there method such as Get_Vertice or Export_obj?
Hi people, my character wearing a T-shirt under the shirt, and the shirt, with its tails out, partially covers the pants.
When I try to paint the influences (skin radio and skin backstop), it turns out that the brush paints based on the visible radius and not by surface. Therefore, when attempting to paint the pants, I end up unintentionally painting part of the shirt, the same goes for the undershirt. I've tried using the back and front culling options, but it's not helpful since the particles I want to paint on the pants have normals pointing in the same direction as the particles I accidentally paint from the shirt.
I have been using Obi Softbody for quite sometime now, and I always have a hard time optimizing the entire Obi system. I changed the backend setting to burst already, downloaded all the required packages (Burst, Collections, Mathematics and Jobs) and set all the constraint iterations to minimum parameters (if possible, 1), but the game still lags PARTICULARLY when two or more softbodies are in contact. I cannot attach a screenshot of the game, because it is still under development, but I will try my best to describe the game system.
Upon level start, there is one Obi solver in the scene. Multiple softbody prefabs will be instantiated as children of this solver. Upon instantiation, the softbody component is disabled to save memory and is only enabled once a certain condition is met. The softbodies are enabled one by one. I attached a screen capture of the solver (solver.png).
Upon meeting another condition, the softbody prefab as a whole is deleted. Including all the Obi-related components. The softbody prefab's heirarchy is included below (heirarchy.png). Center and KeyHolder are just empty transforms, while Skin (skin.png) and Player (softbody.png) are where Obi components are included. I attached a screen capture of these two as well.
The mesh of the softbody I am using has 3328 vertices, 3332 triangles and 2 submeshes.
The softbody blueprint parameters are attached below. Please refer to blueprint.png.
I took a screenshot of the Profiler during the time when the game lags and attached it below. During this time, the game is practically unplayable and just freezes. The weird thing about this is if you set backend to Oni, the freeze issue disappears on the editor, but freezes nonetheless when you build the game on Android. Setting backend to Burst freezes on either environments. For the screenshot, please refer to solver.png.
I can probably send the entire project to you if you have a personal e-mail address to which I can send it to. My observation is that the Burst mode is fine as long as there are no colliding softbodies. Maybe the computation for Obi just overloads with all the collisions happening? If this is the case, might the softbody be subscribed to the OnParticleCollision event? (I did not perform any subscription via script.)
I would appreciate any advice from you, as I have been struggling quite some time with this problem. Even with just 2 softbodies enabled, the game lags and I do not know what to do anymore. Also, the Jobs settings return to default everytime I open the editor and because of this, I have to set it every single time. Is this normal behavior?
I'm working on a 2.5D game with rope swinging/climbing. I've tried a few different approaches to dealing with the climbing, but haven't gotten anything that QUITE works. So far my implementation is:
The actual game mechanics are the character swinging on a hinge joint that's independent of the obi rope. The obi rope is just used for visuals and collision detection, not the swinging rope movement.
When you jump on to a rope, a new particle group is created and attached to the character's hand when the collision box hits
That works fine for attaching to a rope and swinging.
For climbing, it gets trickier. The best version I've found is:
When you climb up and down, each "step" attaches to the next particle up/down
Your attachment to the hinge joint is then re-established based on your new location
This seems to work fine if the rope is steady, but the problem is that if I climb downwards while a rope is swinging, the particle's position is often higher than it would be if at rest, so the rope never extends to its full length. Hard to describe, but video here: https://youtu.be/_TBW25ytktI
Any tips on avoiding this? I tried looking into the following two approaches, but I couldn't find a way to make them work:
1) Move the player independently of the obi rope and then somehow find the closest appropriate particle to attach and move it to the attach point.
OR
2) After attaching, move the player down further if necessary to reach what would be the resting length of the rope at that point. Is there a way to find out how far the attached particle is from the top of the rope?
And in general, do you have any tips on best practices for getting a solid climbing setup? Does my implementation seem reasonable, or will I run into issues in the future that I might not have anticipated? (For example, I don't have climbing animations set up yet, and I could imagine that this could introduce some future headaches that I haven't seen coming...)
The main code used for moving the player is:
Code:
public void AttachNewParticleIndex(int indexChangeAmount)
{
// Get the new particle index that you're climbing towards
int newParticleIndex = GetParticleNeighborIndex(indexChangeAmount);
// Get new position to move to
Vector3 newPos = solver.positions[newParticleIndex];
newPos += transform.position; // Adds the rope's position because the position of the particle is relative to the rope
newPos -= attachedRopeChar.attachTransform.localPosition; // newPos offsets the char's position so that the attach point is aligned with the rope particle
// Detatch char from old position and move towards new one
Destroy(attachment);
Vector3 newCharRotation = new Vector3(0, attachedRopeChar.transform.rotation.eulerAngles.y, attachedRopeChar.transform.rotation.eulerAngles.z);
attachedRopeChar.transform.rotation = Quaternion.Euler(newCharRotation); // reset char rotation
attachedRopeChar.transform.Translate(newPos - attachedRopeChar.transform.position, Space.World); // Move char to the new particle pos
// Create new attachment
attachment = obiRope.gameObject.AddComponent<ObiParticleAttachment>();
attachment.target = attachedRopeChar.attachTransform;
// Create a new particle group and assign it the particle that you are moving to
var group = ScriptableObject.CreateInstance<ObiParticleGroup>();
group.particleIndices.Add(newParticleIndex); // index of the particle in the actor
attachment.particleGroup = group;
}
I just wanna define a object that is partly deformable such as cable.
What I tried is that I created blueprint from cut-out mesh and attached it to original mesh.
However the part of original mesh out of cut-out mesh doesn't have a Collider and allowed other object to pass through.
What to do for creating partly deformable object?
(This kind of case exists: rigid part -soft part - rigid part)
And I wanna do that by Script.
I need to do this as soon as possible...
I have been upgrading from Unity 2019 to 2022.3.8f1
I started getting errors from Obi Rope so installed ECS, Burst and a number of dependencies.
I am now getting this error:
Assets\Plugins\Obi\Scripts\Common\Backends\Burst\DataStructures\NativeMultilevelGrid.cs(74,46): error CS1061: 'UnsafeList<K>' does not contain a definition for 'length' and no accessible extension method 'length' accepting a first argument of type 'UnsafeList<K>' could be found (are you missing a using directive or an assembly reference?)