I have a particle and if it comes into contact with another particle of the same kind they form a cluster (named a micel).
These clusters need to be reshaped and the time they stick together becomes longer when more particles join the micel.
For this I created a micel and micelmanager class to keep everything in order. Those classes basically store which micels there are and in the micels which particles are there.
When creating the micel I give it an ID which gets returned so the particle can store in which micel it is. The problem for me occurs when particles collide and I want to check if the other particle is in a micel and if so adding this particle to that micel.
public void OnTriggerEnter(Collider other)
{
// one collision
if (stickToBinder || stickToSurfactant || stickToThickener)
return;
CurrentCollider = other.collider;
// surfactant head collision
if (CurrentCollider.tag == "head" && this.collider.tag == "head")
{
stickToSurfactant = true;
// read if other particle is in micel!!!
}
}
I can not get “Collider” to “SurfactantParticle” type. This would contain the variable (and method GetMicelID())
On a further note I have to say that all actions surrounding the particles are done via a FSM. But in the FSM I only got the Collider type.
Any ideas how to solve this problem?
well you got me correctly. thanks
– thef1chesserDude vote the answer up XD I wish everyone would give thumbs up to answers that they accept... Wish a checkmark would give an automatic upvote but hey, I'm just a dreamer lol.
– clunk47