Hello, I don't know if this will be answered but I'm working on a Morgan hyper coaster, and came up with these animated brakes there sill very much a work in progress however i was wandering if I could get help with an attachment script, i went looking through the scripts of a couple other brake/lsm packs, and found this one was very commonly used
'import com.nolimitscoaster.;
import nlvm.math3d.;
public class Brakes extends Script{
SceneObject sco;
public bool onInit(){
sco = sim.getSceneObjectForEntityId(getParentEntityId());
float distance = 1.36f;
int maxlength = Integer.parseInt(sco.getName());
SceneObjectElement[] scoe = new SceneObjectElement[sco.getElementCount()];
Vector3f pos = new Vector3f();
sco.getTranslation(pos);
final float range = 10.f;
TrackPos trackPos = sim.findNearestCoasterTrack(pos, range);
Matrix4x4f location = new Matrix4x4f();
for(int i = 0; i < sco.getElementCount(); i++){
scoe[i] = sco.getElementAt(i);
scoe[i].setVisible(false);
}
for(int i = 0; i < scoe.length && i*distance < maxlength; i++){
location = trackPos.getTrackPosOnCenterRailsWithOffset(i*distance).getCenterRailsMatrix();
scoe[i].setMatrix(location);
scoe[i].setVisible(true);
}
sco.setMatrix(new Matrix4x4f());
return true;
}
}
This, would not work for me, so I would like some help getting the track attachments right, according to blender the model is 2.02M long, and about 0.25M wide, also I made a keyframe animation in blender for the brakes clamping, is there a way I can trigger this to happen when NL2 triggers the (invisible) brakes. Thanks for any and all help. Download souce files https://drive.google.com/file/d/18ZlYzbr8dyjj7-L3IZ5EukspRvy2Lgdn/view?usp=sharing (Brakes.dae, brakes.nl2mat, brakes.blend, brakes.nlvm, MorganBrakes.nl2sco)