Car autopilot (simulate typing)

  1. What do I want to achieve?
    I’m trying to make an autopilot for a car.
  2. What is the issue?
    Is it possible to simulate keyboard input (I don’t think so) or change seat properties (I don’t think so).
  3. What solutions have I tried so far?
    I used BodyPosition and BodyGyro but it’s not that good and you can’t steer…

The project link : Tesla autopilot | LEVEL 1 - Roblox

Any idea on how I could do that (if it’s possible but I saw people who made auto driving cars)

you cant do that using the roblox services but you can fire the function in your code not using those

ehh

seat.property = 'new value'

???

You need to use RayCast (also to avoid the car going into buildings) and use Cylindrical constraints instead of body movers and set the correct properties for them in order to move the car and steer

I’ve already made one auto pilot long ago, its quite difficulty to make, you need to know these before making it:

  • Path finding service
  • Vector Force
  • Align Position
  • Align Orientation
  • Ray casting
  • Object and World space
  • Relative attachments
  • Limits of all these things

Also I already made a game like this, and it works, and is due in release, sorry if rude, but please don't make it, I already made it and is done too

1 Like

I’m using raycast and part.Touched:Connect()

Seat.Steer = 1 doesn’t work (it’ll changes it back to 0)

repeat the action, Will refresh back to 0 unless constantly set.

Okay, thanks, but I want to make my own autopilot to custom it and I also want to add more features.

Yeah but even by spamming the game, it doesn’t steer…

The vehicle seat, and user input service is commonly used for manual car movement, while auto pilot does not need user input and can go on its own

The steer property value is like read only even if you can change it that won’t make the car steer and should be used only to know if the player wants to steer right or left

No you can change the value of it using scripts, thats what I do in my manual and auto pilot car

Does it work? I mean, for me it doesn’t, it changes back to 0 even with

game:GetService("RunService").Heartbeat:Connect(function())
Seat.Steer = 1
end)

while wait() do
Seat.Steer = 1
end

I said “like read only” because I don’t see any usefulness in setting that value

But how could I make the car steer then?

As I said in a previous post use Cylindrical constraints (that’s how I would do it for a car driven by a player buy instead of basing the system on a player’s input make an AI) and set the correct actuator type. This could help you to unsteand how to make the car (not the AI)