railroad in blender

is it possible to set out a train on a track and have the track control where the tain will go, much as in physical world? If so can someone give me an example of how to do this in blender? I was hoping that i could use some form of constraints to do this but i have not came up with any viable means…thanks

You could use path animation for the train with an animation path that is identical to the curves of the track. You’ll find info about path animation in the documentation: http://www.blender.org/modules/documentation/htmlI/x6672.html

how can i apply this to the game engine? obviously in this situation we couldnt control or steer the train but control how fast it would go…could i do this with the path animation still?

invisible walls :-?

care to elaborate?

He’s talking about using planes around the tracks and having the train use a forward force to follow it. When setting up your planes in face mode click the invisible button. This will make the plane not show up but the object will still be there and the physics will still work.

You also need your train to be rigid-body so it turns when it hits the walls

ok i see what you mean, but has anyone here ever tried what i am doing now? I would be curious if anyone has attempted to create a train on a track simulation as i am doing, maybe share results?

The game engine is too Mickey Mouse to do anything like that in my opinion.

Here’s a quick demo I made, you can then use a key to switch the tracks. http://www.air-internet.com/~awalker/models/train.blend

maybe, but i think the engine is so universal that you actually have to be smart to come up with new inventive ideas…i think i’ll throw this at the drawing board again…

A train test is quite easy. I made a AI Train that tracks really well on the track. If you replace the 'Always sensor" activating the ‘forwards actuator’ with a ‘keyboard sensor, W’ and you press ‘w’, you will see the cube will turn automaticly when you pass a corner (what is the english name of the road turning?) Anyways this could be a nice train test. :stuck_out_tongue:


The cube pops off of the track after 1 loop.

? Lol on my pc it runs for minutes wihout poping off the track. It depends on each computer fps I think. Try to modify it. :slight_smile:

Did you use 2.25? Because 2.25 doesn’t have that popping bug.

I tried the latest blender 2.34 release (not offical one) and blender 2.25

Did it pop through at all on 2.34 on your comp?

It didn’t even get trough walls on the 2.34 latest release and 2.25. For the reason you ask me posting that blender version. Here it is:
It’s windows build that directly be runned without installing it. No idea from what date it is. :-?

some stuff is too counted on variables, like maybe the train wont follow the exact path everytime…puts a downer on it…

Well th train AI test doesn’t follow anything, It uses invisible walls. When a ray sensor hits a wall it just stears a little in the reversed direction. So whatever you build your track it always fnd his way trough it. Ofcourse he won’t do always the same amount of stearing, but why you want that? In real life a human can’t drive the exact way they did yesterday. :slight_smile: