Code:
void SetStartPos(ObiActor actor, ObiActorBlueprint blueprint){
print("Eventfired");
if(followRig){
//print("following "+followChain.Length);
var Bendtwist = rope.solverBatchOffsets[(int)Oni.ConstraintType.BendTwist];
int b = 0;
int b2 = 0;
bool batch = true;
Quaternion prior = followChain[0].rotation*orientInverse[0]*particleOrigional[0];
for (int i = 1; i<chain.Length-1;i++)
{
Quaternion next = prior;
prior = followChain[i].rotation*orientInverse[i]*particleOrigional[i];
if (batch){
solverConstraints.batches[0].restDarbouxVectors[Bendtwist[0]+b] = ObiUtils.RestDarboux(next,prior);
batch = false;
b++;
}
else {
solverConstraints.batches[1].restDarbouxVectors[Bendtwist[1]+b2] = ObiUtils.RestDarboux(next,prior);
batch = true;
b2++;
}
solver.positions[rope.solverIndices[i]] = followChain[i].position;
solver.orientations[rope.solverIndices[i]] = followChain[i].rotation*orientInverse[i]*particleOrigional[i];
}
for(int i = 0; i<rope.particleCount;i++){
int index = rope.GetParticleRuntimeIndex(i);
}
}
}
private void Awake() {
rope.OnBlueprintLoaded += SetStartPos;
}
Eventfired never shows up in my console...
It turns out this is because this is a different object, and on enable is before the awake of this object
Also im getting a lot of crashes in my scene the heavier it gets with obi actors