12-11-2019, 12:29 PM
Hi,
The TrainManager script, which is just an example script, not something that has the quality needed to be on production, has a Position field. This field is used in the setup method to define the position of all the wagons. This happens in two situations:
When you modify the field's value via the Animator, nothing will happen. If you want it to be used immediately to override the wagons' positions, then the easiest way to do it (and not the most efficient) is to comment the first line of the LateUpdate method. This will make the setup method run every frame. Overkill, yes, but it works.
For the long term, I advise you to use what you learnt from the example scripts to write your own train manager that will suit perfectly your needs.
Did this help?
The TrainManager script, which is just an example script, not something that has the quality needed to be on production, has a Position field. This field is used in the setup method to define the position of all the wagons. This happens in two situations:
- At the script start
- When values are modified through the inspector
When you modify the field's value via the Animator, nothing will happen. If you want it to be used immediately to override the wagons' positions, then the easiest way to do it (and not the most efficient) is to comment the first line of the LateUpdate method. This will make the setup method run every frame. Overkill, yes, but it works.
For the long term, I advise you to use what you learnt from the example scripts to write your own train manager that will suit perfectly your needs.
Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.