# change direction of train (solved)

Get help using Construct 2

### » Mon Aug 26, 2013 3:35 am

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? :DSargas2013-08-26 11:19:44
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

### » Mon Aug 26, 2013 8:09 am

Did you try pinning them?
B
52
S
21
G
93
Posts: 2,410
Reputation: 55,008

### » Mon Aug 26, 2013 9:37 am

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.
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

### » Mon Aug 26, 2013 9:48 am

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?
B
52
S
21
G
93
Posts: 2,410
Reputation: 55,008

### » Mon Aug 26, 2013 11:10 am

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 =(
B
43
S
12
G
6
Posts: 446
Reputation: 6,807

### » Mon Aug 26, 2013 11:19 am

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...
B
43
S
12
G
6
Posts: 446
Reputation: 6,807