Latest Threads |
Stretching verts uniforml...
Forum: Obi Softbody
Last Post: Aroosh
Yesterday, 05:32 AM
» Replies: 0
» Views: 83
|
Scripting rod forces
Forum: Obi Rope
Last Post: chenji
11-09-2025, 01:15 PM
» Replies: 25
» Views: 2,803
|
Burst error causing crash...
Forum: Obi Rope
Last Post: josemendez
10-09-2025, 07:03 AM
» Replies: 1
» Views: 201
|
Controlling speed of emit...
Forum: Obi Fluid
Last Post: josemendez
06-09-2025, 06:29 AM
» Replies: 1
» Views: 455
|
Looks nice on editor but ...
Forum: Obi Fluid
Last Post: josemendez
04-09-2025, 07:20 AM
» Replies: 3
» Views: 701
|
How to Shorten or Scale t...
Forum: Obi Rope
Last Post: josemendez
02-09-2025, 09:53 AM
» Replies: 5
» Views: 788
|
The Limitation of Using O...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 10:30 PM
» Replies: 1
» Views: 527
|
Bug Where a Straight Segm...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 08:46 PM
» Replies: 1
» Views: 500
|
Having an issue with obi ...
Forum: Obi Rope
Last Post: Ben_bionic
29-08-2025, 04:23 PM
» Replies: 4
» Views: 997
|
Non-uniform particle dist...
Forum: Obi Rope
Last Post: chenji
29-08-2025, 09:05 AM
» Replies: 4
» Views: 846
|
|
|
Liquid-to-Liquid Collision |
Posted by: gotou - 14-01-2021, 04:31 PM - Forum: Obi Fluid
- Replies (3)
|
 |
I am developing a chemical experiment environment using VR.
My plan is below.
When user mixes liquid A and liquid B, after that, its mixed liquid is displayed as a percentage; 70% or more is "perfect", 40% or more is "successful", and under 39% is "Failed" respectively.
Also, if liquid A is mixed with liquid C, an explosion is happened and "Failed" is displayed.
However, I made, installed and runed the scripts, nothing happened on VR. I think the reason why I cannot get the collision between particles.
However, I am not sure how to modify the script.
If you know the solution. Could you assist me?
Reference: Obi Fluid's sample "Maze", "Obi Manual" http://obi.virtualmethodstudio.com/tutor...rials.html Assets I'm using: SteamVR Plugin, SAColliderBuilder, Obi Fluid Version of Unity: Unity 2019.4
I am looking forward to hearing your answer.
Sincerely yours,
Code: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using Obi;
[RequireComponent(typeof(ObiEmitter))]
public class Chemicalreaction : MonoBehaviour
{
[System.Serializable]
public class ScoreChangeEvent : UnityEvent<int, int> { }
public List<ParticleCollisionEvent> collisionEvents;
public ObiSolver solver;
public ObiEmitter emitterA;
public ObiEmitter emitterB;
public ObiEmitter emitterC;
public ObiCollider finishLine;
public Text completionLabel;
public Text mixLabel;
public Text finishLabel;
public Text Gameover;
HashSet<int> finishedParticles = new HashSet<int>();
HashSet<int> coloredParticles = new HashSet<int>();
void Start()
{
solver.OnParticleCollision += Solver_OnParticleCollision;
collisionEvents = new List<ParticleCollisionEvent>();
}
private void OnDestory()
{
solver.OnParticleCollision -= Solver_OnParticleCollision;
}
private void Solver_OnParticleCollision(ObiSolver s, Obi.ObiSolver.ObiCollisionEventArgs e)
{
var world = ObiColliderWorld.GetInstance();
foreach (Oni.Contact contact in e.contacts)
{
ObiSolver.ParticleInActor pa = solver.particleToActor[contact.particle];
if (contact.distance < 0.01f)
{
var col = world.colliderHandles[contact.other].owner;
if (emitterB.GetComponent<ObiEmitter>() == pa.actor)
{
if (coloredParticles.Add(contact.particle))
UpdateScore(finishedParticles.Count, coloredParticles.Count);
}
else if (emitterC.GetComponent<ObiEmitter>() == pa.actor)
{
if (coloredParticles.Add(contact.particle))
Gameover.text = "Failed";
}
else if (finishLine == col)
{
if (finishedParticles.Add(contact.particle))
UpdateScore(finishedParticles.Count, coloredParticles.Count);
}
}
}
}
public void UpdateScore(int finishedParticles, int coloredParticles)
{
int completion = Mathf.CeilToInt(finishedParticles / 600.0f * 100);
int mix = Mathf.CeilToInt(coloredParticles / 600.0f * 100);
completionLabel.text = completion + "% Completed";
mixLabel.text = mix + "% Mixed";
if (completion > 50)
{
if (mix > 70)
{
finishLabel.text = "Perfect!";
}
else if (mix > 40)
{
finishLabel.text = "Successful";
}
else
{
finishLabel.text = "Failed";
}
finishLabel.gameObject.SetActive(true);
}
}
}
|
|
|
Could not find namespace Obi |
Posted by: MonaGermany - 13-01-2021, 08:55 AM - Forum: General
- Replies (2)
|
 |
Hello!
I have more than one Project in my Visual Studio Solution. In the first Project I can work with Obi just normally and everything works fine. But in the other Projects I can't use it. I added the references Obi.dll and ObiEditor.dll there per hand and afterwards I don't get Errors in Visual Studio any more.
The Problem is, that Unity always shows me this Error:
error CS0246: The type or namespace name 'Obi' could not be found (are you missing a using directive or an assembly reference?)
I really tried out different things to solve this Problem, but nothing worked so far.
Thanks in advance for your help!
Greetings
Mona
|
|
|
[Solved] Initialize help |
Posted by: Samadhi - 08-01-2021, 11:11 PM - Forum: General
- Replies (2)
|
 |
Hello everyone.
I just downloaded this asset, specifically the fluids version, and started playing around with the sample scenes to get a hang of it. Now I started to use it in a new project and it seems I have problems to make it work.
In my scene I have an ObiFixedUpdater, an ObiSolver, an ObiEmitter as a child of said ObiSolver, and a blueprint attached to said ObiEmitter; so I should have everything needed to make it run.
I checked through code and it seems the solver does have the emitter in its list of actors. I also checked the "isEmitting" property of the emitter but it always returns false. I tried running the "EmitParticle" method but it returns false.
What I have noticed, though, is in the solver, it has an information box saying: "Used particles: 0". I believe the problem might be here as I checked the sample scenes and in all of the ones I checked, their solver had a number there (above the thousand). But I don't know how to create the pool of particles. Even in the sample scenes, when I try to create another solver, the new solver still remains in 0.
Any help would be appreciated. Thanks.
|
|
|
Compatible with Oculus Quest? |
Posted by: taylorjames9 - 08-01-2021, 10:10 PM - Forum: Obi Fluid
- Replies (13)
|
 |
Are there any instructions or tips for setting up Obi Fluid so that it will show in Oculus Quest? We have been able to successfully verify that Obi Cloth and Obi Softbody work in Quest, but we have not been able to verify that Obi Fluid is visible in headset. We have downloaded and installed the Burst package and jobs system. I have put the Obi Fluid Renderer script on all cameras rendering VR. I see a tip in Frequently asked Questions that says that we need a "different camera for each eye", but I'm not sure how that's different from the two cameras that are set up in the OVR (Oculus) camera rig prefab.
Are there any tips or instructions for getting this to work on Quest 1 or Quest 2? Any success stories? We have also set the Project Settings->Oculus -> Stereo Rendering Mode to Multipass. We certainly look forward to using this package. Thank you in advance for any help and advice.
Best,
-James
|
|
|
|