Latest Threads |
Fluid are always Opaque
Forum: Obi Fluid
Last Post: mimaree
35 minutes ago
» Replies: 0
» Views: 5
|
does not render correctly...
Forum: Obi Fluid
Last Post: josemendez
Yesterday, 12:52 PM
» Replies: 3
» Views: 532
|
Foam Rendering suggestion...
Forum: Obi Fluid
Last Post: josemendez
Yesterday, 10:43 AM
» Replies: 1
» Views: 108
|
Cloth grab with skinned m...
Forum: Obi Cloth
Last Post: josemendez
Yesterday, 08:55 AM
» Replies: 1
» Views: 62
|
Extend Rope on Stretch
Forum: Obi Rope
Last Post: josemendez
30-10-2024, 08:53 AM
» Replies: 1
» Views: 72
|
Garment explodes on Andro...
Forum: Obi Cloth
Last Post: CptnFabulous
28-10-2024, 11:14 AM
» Replies: 0
» Views: 76
|
Can I attach particeattac...
Forum: Obi Cloth
Last Post: gahyun11
28-10-2024, 03:43 AM
» Replies: 28
» Views: 2,905
|
Can;t get scaling and beh...
Forum: Obi Fluid
Last Post: josemendez
23-10-2024, 09:58 AM
» Replies: 9
» Views: 656
|
keep distance between two...
Forum: Obi Cloth
Last Post: josemendez
23-10-2024, 09:46 AM
» Replies: 1
» Views: 176
|
Android rendering doesnt'...
Forum: Obi Fluid
Last Post: Rearden
21-10-2024, 11:03 PM
» Replies: 7
» Views: 557
|
|
|
ArgumentNullException: Value cannot be null. Parameter name: key |
Posted by: diegoaguirreh - 16-01-2021, 02:56 AM - Forum: Obi Cloth
- Replies (2)
|
|
Hello everyone!
Hope you have a great weekend. LongStory-Short Story im getting this error
"ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <9577ac7a62ef43179789031239ba8798>:0)
Obi.ObiTriangleMeshContainer.GetOrCreateTriangleMesh (UnityEngine.Mesh source) (at Assets/Obi/Scripts/Common/Collisions/ObiTriangleMeshContainer.cs:78)
Obi.ObiColliderWorld.GetOrCreateTriangleMesh (UnityEngine.Mesh mesh) (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:229)
Obi.ObiMeshShapeTracker.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ColliderTrackers/Trackers3D/ObiMeshShapeTracker.cs:38)
Obi.ObiColliderBase.UpdateIfNeeded () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderBase.cs:189)
Obi.ObiColliderWorld.UpdateWorld () (at Assets/Obi/Scripts/Common/Collisions/ObiColliderWorld.cs:362)
Obi.ObiUpdater.BeginStep (System.Single stepDeltaTime) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:40)
Obi.ObiFixedUpdater.FixedUpdate () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:54)"
I'm using Unity 2020.2 and I everything was fine until I updated to the new Obi cloth.
Please HELP! I'm going to lost my job if I don't figure this out soon.
|
|
|
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
|
|
|
|