I would like to make a stable train physics system using body position. In other posts I’ve seen that people say to use other methods but after looking at it more SCR uses body position and body gyro which makes derailment impossible and the trains run along the tracks smoothly without any issues.
Now I know you can use track nodes etc, but in my rail simulator the path the train could take will not always be the same, this can differ from route, to operator or if a junction needs to direct me to a free platform incase the other one is occupied.
When I also had a closer look at SCR’s the BodyPosition.Position will always change depending on where you are moving to, even down into decimal figures. This also goes for the body gyro.
I couldn’t find any track nodes or sensors that guides the train and if there were sensors there would of have to of been like 10 every stud.
Now I could just make a script that just adds a Vector3 of (1,0,0) which would indeed make the train go in one direction but then what do I do about turns or slopes? Well it would obviously involve body gyro but I would still need a way to detect if the train is turning or going up / down a slope.
Now one theory I have is that the train has one centered engine part in the middle of the coach and then a part infront rotates or changes depending on what way the track is going and then the engine’s body position and adjusts to it.
I also plan for these trains to be manually controlled with throttle and allow it to be instantly stopped if an emergency brake is applied.
Someone recommended pathfinding but it would just jump off of the tracks as it was designed for a humanoid based model and planting individual points would take ages but also not work due to the train possibly taking different routes
Thanks for reading this and I hope someone could help me with this.