04-07-2022, 11:57 AM
(19-11-2020, 02:24 PM)canerozdemir Wrote: Oh, I missed that one. However, the outcome is still the same. FPS drop happens and the game becomes unplayable. This is the code:
Code:public class RopeCollision : MonoBehaviour
{
private ObiSolver _solver;
private ObiSolver.ObiCollisionEventArgs _collisionEvent;
private void Awake()
{
_solver = GetComponent<ObiSolver>();
}
private void OnEnable ()
{
_solver.OnParticleCollision += Solver_OnParticleCollision;
}
private void OnDisable()
{
_solver.OnParticleCollision -= Solver_OnParticleCollision;
}
private void Solver_OnParticleCollision (object sender, ObiSolver.ObiCollisionEventArgs e)
{
var world = ObiColliderWorld.GetInstance();
foreach (var contact in e.contacts)
{
// this one is an actual collision:
if (contact.distance < 0.01)
{
var theCollider = world.colliderHandles[contact.other].owner;
if (theCollider)
{
print(theCollider.name);
}
}
}
}
}
why am I getting this error :- Assets/Scripts/RopeCollision.cs(37,58): error CS1061: 'Oni.Contact' does not contain a definition for 'particle' and no accessible extension method 'particle' accepting a first argument of type 'Oni.Contact' could be found (are you missing a using directive or an assembly reference?)
Assets/Scripts/RopeCollision.cs(38,58): error CS1061: 'Oni.Contact' does not contain a definition for 'other' and no accessible extension method 'other' accepting a first argument of type 'Oni.Contact' could be found (are you missing a using directive or an assembly reference?)