Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing train speed
#1
I am trying to change the train speed with a slider in the the Train example scene.
However whenever I adjust the speed in TrainManager.cs  , it reverts the trains position back to 0 on the spline. 
How can I adjust the trains speed on the fly ?


Thanks
Reply
#2
You tried this in the editor while having TrainManager in the inspector? It's just an example script, so setting speed does trigger OnValidate() and there reset() is called who reset positions.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Accessing generator's input spline in script, changing it at runtime smackledorf 3 106 06-17-2021, 01:59 PM
Last Post: _Aka_
  Train car orientation on slopes bennidhamma@gmail.com 3 414 03-26-2021, 10:30 AM
Last Post: _Aka_
  Controller speed questions Lupp_ 6 879 01-20-2021, 09:20 PM
Last Post: _Aka_
  Player to Train DeadCcell 3 666 12-08-2020, 08:07 AM
Last Post: _Aka_

Forum Jump: