change direction of train (solved)

0 favourites
  • 6 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • CAPX

    Hello guys!

    I made this capx where you create 2 train stations (wherever you want) and the tracks are dynamically set between them. then you can create a train that follows the track and change angle depending on the angle of the segment they're on.

    however i don't know how to make the whole train change side when reaching a station instead of every car turning when reaching the station. My trains behaves like 3 independent carts and not as a connected train =(

    i've been trying to solve this for over a week now, any help? :D

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Did you try pinning them?

  • that wouldn't work, the train needs to stay on track and change the track of each cart independently =(

    I guess is something along the lines of using a variable to determine which side the train should be moving to.

  • It isn't very clear what you want to happen. Yes the carts act independently, if you pin them together they will act as one train. What else do you want it to do?

  • well... when a train moves, it does as a whole (like my train along the tracks), but when it reaches it's destination it also stops as a whole (which mine doesn't,in my case each carts has to reach the destination before turning around). but because of the way my train works (moving from node to node) i can't just pin it together, or it would look all sorts of wrong, and won't work, please try it and you'll see.

    maybe there is an alternative solution for the "moving along the tracks" thing that didn't occur to me. i couldn't make it work with pathfinding, so i had to make it with a self made movement.

    any solutions for this would be really appreciated. i'm kinda stuck with this =(

  • well... i feel really stupid, all i was doing wrong was the way a picked the carts. I had them in a family and all, but in the actions i should have used it and i was referencing the instance instead...

    silly me...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)