Can someone help me understand how to create a passenger script entering and leaving the bus like this
??? help???
You would need a few scripts from my perspective:
One for the bus - Holds a list of seats that contain an empty gameobject for its location and who its occupied by. Then allocate seats accordingly as passengers come and go.
One to give to the passenger - This will direct them to their seat, personally I would create some waypoints in the bus to act as a spline then work out the seats closest position the spline. Then just get the passenger to follow the spline to their seat.
If you want to have passengers waiting at stops, queueing to enter, waiting for stops etc you may want to look into behaviour trees.
Could help me create I have no idea where it starts because I have never done such a script and I am willing to learn.
Start writing something and post on the forums when you get stuck.
All you really need to do to have a character be on the bus is to set their position to a seat, lock any movement control on them and child them to the vehicle.
help plz ![]()
how can I do it
are there any sources