OpenBVE
OpenBVE copied to clipboard
TrackFollowerFunction makes the moving object disappear after a certain distance away from its origin
Here's a video of what happens: https://youtu.be/Y0U_genJ3pA
To reproduce, link an animated object with TFF(TrackFollowerFunction) to any route, operate any train to where the object is, and keep operating for a little bit. The formula I used is this:
TrackFollowerFunction = ( trackDistance[0] <= 11 ) * ( value + speed * delta )
That doesn't surprise me. Whilst I don't know (off the top of my head) the exact cause of this, as a very general rule of thumb, any object will be visible for the following: Take the track position the object is placed at. Move to the end of block. (25m unless altered with Options.BlockLength) Add the total positive Z length of the object. Add the viewing distance.
This is (approximately) when the object will disappear.
It's not really designed to do what you're attempting in the first place, but more for something like a passing train on a curve.
I haven't got an immediate solution to do what you want (not even tried thinking about physics for loose cars), but my immediate nasty, hacky thought would be attaching objects to the train externals. In the XML format, you can set VisibleFromInterior on a train car. Set this to true, but use an animated function to hide the object until the coupling distance is hit. Similar animated function in a dummy on-track object.
Made some changes which will hopefully fix this in the latest nightly build.
Wouldn't really reccomend this, but might give the effect that you're after now :)