#GTA LIKE CAR SCRIPTS
1 messages · Page 1 of 1 (latest)
How do gta cars work
@rain fulcrum following lane, NPC throw out, following other car and honking at people
** You are now Level 1! **
No one here is gonna write a full script for all that plus you need more than just a script to set all that up
Go to #💵︱hiring
Or I can help give the idea on how it works
What you want to do, right
Is you make a cat
Car
And you give it the ability to choose where to go
You could set up the roads in a grid
That would make it really easy
Even if it's not a grid as long as the roads arent completely curve it shouldnt be to hard
You could set a node on each road and where it connects write a pathfinding alg based on that and it shouldnt be too expensive
And then make the car follow it based the road
Have the straight part of the road one part and the intersection or turn another
And based on that you could make it all stitch together based of the length and width and position of the roads
Pathfinding worked for straight line but During turn it messed up
So, it was hefty process, is there any assets with city roads and car?
It should not be a hefty process unless you have thousands of road
Mine is grid too, but it has to turn left or right
Send a picture with the code
Pic of road
And code
What are the green and red boxes
it's going to be a big map
it's to detect NPC, player, car and traffic
It becomes invisible during play
How do you have tons of code of you don't know how to
Just let me see the pathfinding
** You are now Level 14! **
I know how to code (intermedite) btw, pathfinding is not implemented in this, I tried that before not much help, so i changed to point based
car moves based on points
That's kinda what I said but just use each point for the pathfinding
straight line works with pathfinding, but car never turns 180* perfectly
felt so robotic
Let me see the code for it
Use interpolation with some randomiaztions
...