|
|
Change size of spheres using Softbody |
Posted by: charlieatron1 - 15-05-2024, 06:52 PM - Forum: Obi Softbody
- Replies (4)
|
|
I'm trying to make a simulation of many sphere-shaped cells that swim around and squish into each other, with each sphere being a Softbody actor in a single Solver. Ideally I'd like to be able to change the size of a single cell during runtime, for instance if one eats a food particle it will bump up in size slightly. The bigger cell would push other cells out of the way as it takes up more space.
I did see one other post on the forum saying that scaling the actors is not possible, but I'm wondering if there's any potential workarounds? I figured that spheres are a lot simpler than a detailed mesh, so it could be possible to achieve the same effect somehow through a force, constraint value, modifying blueprint, etc., but I'm not familiar enough with the plugin yet to know what to try.
Does anyone know how to achieve something like this, or have any ideas for things to try out? Or is this not possible? Thanks!
|
|
|
Request a different way to spawn particles. |
Posted by: spikebor - 15-05-2024, 06:37 AM - Forum: Obi Fluid
- Replies (2)
|
|
First, I want to use Obi particle as a way to shoot things > collect contacts > do gameplay things like apply damage.
But when I use the Obi Emitter, I see there is really heavy limitation.
It only has a speed value, albeit having a lot of shapes to spawn from, it still cannot do things like shoot a particle(s) with a target velocity.
The speed value tied to both spawn rate and particle speed.
That is: low speed value will spawn less particles, and the spawned particles also have less speed.
Big speed value will spawn more particles, and they fly with high speed.
This is not good, this leaves a hole where we want a low particle spawn rate, but travel at high-speed.
So can you consider add a scripting API that does Spawn(int count, float velocity);
Thank you!
Edit: Anyway, I think I should forgo this idea about using particle > collect contacts > do damage thing, this is better task for shuriken since it has no limit in collision size.
Obi particle can't have big size as I just tinker with the Granular blueprint, and found out that it can only go as far as max 1.
|
|
|
Unable to load DLL 'Oni'. |
Posted by: Rabidus_4k - 14-05-2024, 03:19 PM - Forum: General
- Replies (3)
|
|
Code: Unable to load DLL 'Oni'. Tried the load the following dynamic libraries:
Unable to load dynamic library 'Oni' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "Oni" not found
faced with the problem that unity is sending errors
Stack trace
I also checked Any Platform in Obi.asmdef as i build apk file. previously it worked fine!
|
|
|
Changing solver gravity vector has no effect on particles |
Posted by: T-1000 - 13-05-2024, 06:21 PM - Forum: Obi Fluid
- Replies (2)
|
|
I have a scene in Unity that uses Obi Fluid. The flow of the fluid can be controlled by rotating the Obi solver's gravity vector in response to WSAD (or the gyroscope input when running on a mobile device, which I haven't tested in the new version but which worked in the old). Note that changing the gravity vector is more convenient programmatically than rotating scene objects because it means I can more easily use a generic script. It also seems to be more stable than rotating geometry.
This all works fine when using `Obi Fluid v6.0.1 in Unity 2021.3.31`, but no longer works using `Obi Fluid 6.5.4 in Unity 2022.3.28`.
In the old version, I set the gravity vector in the `void Update()` method using
Code: if (Input.GetKey(KeyCode.W))
{
obiSolver.parameters.gravity = Quaternion.Euler(0, 0, zRotationRate * Time.deltaTime) * obiSolver.parameters.gravity;
}
obiSolver.PushSolverParameters();
(and three others for the other keys), and it works fine (I write the gravity vector to a textbox afterward) - the particles move in response to the changing direction of gravity.
However, in the new version this doesn't actually change the parameter at all. Weirdly, after some trial and error, I found I have to use a temporary `Vector3` variable and then set the parameter.
Code: if (Input.GetKey(KeyCode.W))
{
TempGravityVector = Quaternion.Euler(0, 0, zRotationRate * Time.deltaTime) * TempGravityVector;
}
obiSolver.parameters.gravity = TempGravityVector;
obiSolver.PushSolverParameters();
After setting `TempGravityVector = obiSolver.parameters.gravity;` in the `Start()` method, obviously). That does set the gravity parameter. However, it has no effect on the particles at all. The gravity vector does change but the particles don't seem to know it, and I'm flummoxed as to why. Anyone have any ideas?
PS I haven't tried other combinations of versions of Obi and Unity as that would seem to me to be a nightmare.
|
|
|
Problems deleting obi colliders with pin constraints |
Posted by: btduser - 12-05-2024, 07:29 AM - Forum: Obi Rope
- Replies (7)
|
|
Hello, I'm trying to do something seemingly trivial - to cleanly delete an object with an ObiCollider and not have my pin constraints blow up - but apparently it's complicated.
I'm creating these pins via scripting, following examples from the documentation. The pinning works fine until I destroy a collider in my scene. When that happens, my console starts getting spammed with the following:
Code: System.IndexOutOfRangeException: Index 15 is out of range of '15' Length.
This Exception was thrown from a job compiled with Burst, which has limited exception support.
[redacted rest due to forum anti-spam]
After a lot of excruciatingly painful debugging, I finally have an idea of why this is happening, but no idea how to proceed.
From what I have gathered, the issue is due to the fact that when I destroy (or disable) a collider, this changes the number of items in `ObiColliderWorld.instance.colliderHandles`, but the collider handle indexes in the pin constraints don't ever get updated. This also happens if I disable the object. Presumably because in either case, `ObiColliderBase.RemoveCollider` is invoked, which modifies the collider handle list.
This either spams burst errors or causes the rope to jump to completely unrelated obi colliders. Even just disabling and re-enabling an obi collider will steal ropes from other objects - e.g. if I have 10 colliders in my scene, with a pin on collider A at index 9, disabling collider B at index 5 rearranges the list so that A is now at index 8 and index 9 is invalid, which will spam errors until I re-enable B, which causes B to get assigned index 9 again, and now the pin is pointing to B instead of A.
I have no idea how to proceed. I've tried deleting the collider at different steps of the process (using the actor callbacks) in case it was timing-related, but the issue persists. Explicitly calling `rope.SetConstraintsDirty(Oni.ConstraintType.Pin);` after destroying my object doesn't seem to fix anything either.
I don't know what I'm doing wrong - it seems like the issue is a fundamental one, that removing any collider in the scene has the potential to break completely unrelated pin constraints. The only solution I can think of is to modify my pins any time any obi collider is destroyed, but I don't see how that's feasible, since there's no way to make pins immediately aware of the change.
I'm using obi 6.5.4 with burst backend (burst 1.8.14), and the problem persists with oni backend as well (ropes just jump to wrong colliders instead of throwing exceptions). I'm basically at my wit's end here - any help is appreciated.
|
|
|
|