Debugging Animations
This page is designed help solve and problems you may run into when creating Animations.
Train Does Not Move From Stop
Train does not move from it's current spot
Solutions
- If
stopWhenDirectionChanges
is flagged in the SimulationState, check if the train moves in the direction you want the to move.
Rollbacks
Train rolls back, does not make it up a hill, in a place where it's supposed to.
Solutions
Check if the section Start and End positions
- If using a Train midpoint other than
0.5
, check if the position, plus or minus half of the train's total length will fit it.- For lifts, this may mean extending it past where the actual chain since it will still be pulling the rest of the cars after the first one exits or will not be engaged until the first one enters.
- See Train Model Setup for more information about the MidPoint
- If using a Train midpoint other than
Check if the Type actually moves the train
Check if the Acceleration or Deceleration is a non-zero value
Increase the Acceleration or Deceleration
Train Zooming
Train zooms around the track, or gets to a certain part then zooms around the track.
It's a combination of two things:
- The
stopWhenDirectionChanges
flag in theSimulationState
for the PhysicsSimulator stopping the simulation early on rollbacks/direction changes.- This is
:withStopWhenDirectionChanges()
call in the Builder
- This is
SpringSimulator
orEasingSimulator
simulating the train slowing down in the station
Direction changing means the train rolls back somewhere along the track
PhysicsSimulator.simulate
will return the reason why the simulation was stopped.
Type of StopPosition.DirectionChanged
means the train has rolled back/switched move directions
Solutions
- Double check your
TrackSectionsData
for that section - If train is meant to rollback, un-flag
stopWhenDirectionChanges
or use two simulation pass-throughs, one before and one after the rollback.