please a litttle help with that
not only with the traffic of the cars but people on the street
ill give a model of your choice of course if i have it xD
do you mean AI ?
You’ll “give” a model?
This post cannot possibly be serious. Doing an AI for traffic simulation is a lot of work, it’s not something people are just going to put together while waiting a burrito finish up in the microwave.
just use basic transform.translate(#,#,#); and add your numbers where the number signs are and/or use this link as a reference on how to do it the right way:
http://unity3d.com/support/documentation/ScriptReference/index.Common_Operations.html
… easy… just make a script that has one or 2 lines like that and add it to your cars anyways…that is the most basic traffic anyways… the people need to be animated the right way i think and that would take time…and/or use iTween to animate the people or cars … it would only take a lot of time to do and adding those scripts the right way… do it and learn ? then you can make games instead of asking to make them …but then again if u get stuck , you can always ask for help when you need it
You need to break the problem down into manageable bits.
For the traffic think about what a vehicle will do…
- Travel in a direction to a waypoint.
- Starting from zero speed, accelerate to a given speed (speed limit for the road it’s on perhaps).
- Having reached a waypoint move to the next until the destination is reached. (More likely make this a looped set of waypoints e.g. travel in a square around a block of buildings).
- What happens at road junctions? If it doesn’t stop you’re going to have a lot of crashes!
For the people you can think along similar lines
- Some may be “static” in as much as not moving anywhere (e.g. a newspaer seller) - just an animation sequence.
- Others may have a purpose (like the cars - use waypoints).
This is far from complete but as has been implied above, it’s a massive amount of work and really needs you to put some input in rather than expect it to be given to you. Pick one of the points above and see if you can at least work out the logic needed (if not some code). Then you may be able to get some valid assistance.
Ok
guys forget about it
i dindt knew that it was so hard :S
cool thanks
It is hard, but you have to break down as was said. Definitely, there is no chance somebody will just pop up with “Oh, here is a script to do traffic how you need it to be done.”
As Prodigalpops said, break it down and work on aspects of the complete picture.
- Get something moving from A to B.
- Get something stopping at B for a certain amount of seconds, controlled by B itself and not the thing travelling on it (to simulate traffic lights), and then proceeding to C.
- Get 2 things sharing the same data to move from A-B-C, at intervals that ensure 2 things arent in the same place at once.
etc, etc.
edit: Also, look around and find as many Siggraph/GDC, etc. papers as you can on the topic
ok men ill have it in mind
The first thing you should probably do is determine what you need it for.
If you have a satellite-view game and want to bring some “life” to a city, a simple algorithm will probably do, as during gameplay the player won’t be following any individual object closely, so he’ll not notice if the same cars are only ever going back and forth the same street. Some random variation and simple paths would do.
On a groundlevel-view, though, things are probably more interesting, as you need more details and more consistent behaviour. Then it depends a lot on the type of game. In the GTA series, for example, traffic is largely random and only simulated near the player. Since you rarely stay in one place or follow someone else for a longer period of time, that is perfectly OK. It might not work so well for a slower or faster game, though.
what if it is a oonline groundlevel-view?