Search the Community
Showing results for tags 'Vehicle'.
Found 5 results
-
Hello. Function in Vehicle class "SetAcceleration" don't work after update. The car stand still and isn't driving, only work steering function and is moving by inertia. I used lua script for create vehicle. Please, help me! Code of my test script: function Script:Start() vehicle = Vehicle:Create(self.entity) local tiremodel={} table.insert(tiremodel,4) for i=0,3 do tiremodel[i]=self.entity:FindChild("w"..i) tiremodel[i]:SetShape(nil) if i < 2 then vehicle:AddTire(tiremodel[i],true) else vehicle:AddTire(tiremodel[i]) end end vehicle:AddAxle(0,1) vehicle:AddAxle(2,3) if vehicle:Build()==false then Debug:Error("Failed to build vehicle.") end vehicle:SetEngineRunning(true) vehicle:SetTransmissionMode(true) vehicle:SetHandBrakes(0) end function Script:UpdatePhysics() local steering=0 if window:KeyDown(Key.A) then steering=steering+30 end if window:KeyDown(Key.D) then steering=steering-30 end vehicle:SetSteering(steering) local gas=0 if window:KeyDown(Key.W) then gas=gas + 0.1 end if window:KeyDown(Key.S) then gas=gas - 0.1 end vehicle:SetBrakes(0) vehicle:SetHandBrakes(0) vehicle:SetAcceleration(gas) end
-
Hi! I was wondering if someone can point me a basic tutorial or example on how to create simple vehicle with 4.4? I haven't loaded workshop cars because, if I understood correctly, they were made for 3.x and vehicle physics have changed since. I also read that they were disabled at some point, is that still the case? I guess not when watching this cool video I would appreciate any tips, thanks!
-
I'm more an artist than a coder and was looking at the FPS Script to get a rough idea but can't figure out how to control a spacecraft. Basically : orbit around the spacecraft on key toggle W - accelerate S - slow down / backward A / D - roll Mouse - yaw / pitch with zero gravity If there is already a tutorial that I missed (YouTube ?) let me know, otherwise any help most welcome
-
My lua project was fine and I left it for a few weeks. Now when I load it up the vehicle's forward/reverse controls are reversed. Couldn't figure it out so I created a new project with just flat terrain and shadmar's prefab car. Reversed controls.. Anyone else experiencing this or did I mess something up?
-
I'm running into a problem where I want to manually select a location for a car to teleport to. Anyway, SetPosition() on self.entity causes weird physics glitches if the new position is too far away. Is there a way to manually change positions? I need cars to disappear and respawn in a city full of cars (and it's obviously impractical to put hundreds of cars in at once), so I was just going to move them, but I'm open to hearing other suggestions!