Feedback on my vehicle I have been working on

The vehicle I’ve been building for the past few days is just a glorified and vastly improved version of Building a basic car. I (sort of) rewrote some parts of the original script from that tutorial and after hours of learning about constraints, The handling of the vehicle is way better than it was before (especially the steering).

I am clearly not done with it yet, I didnt add sound effects or animated the steering wheel/pedals yet (I dont know how to animate normal parts) or even add a proper body for the chassis.


Driving:


However I cant seem to remove this error:
RobloxStudioBeta_DItxaYczW5

I had this error before and knowing that it could cause issues in the long term and had no success fixing it.

So this is my project that taught me into constraints in a basic level and probably some animating. If you want to suggest any improvements or any thoughts about it then let me know. Thanks for reading.

3 Likes

Are there aerodynamic physics in your game that can change the speed of a car depending on its body/shape?

No not really, Im more of a self taught programmer than someone that deals with physics. It’ll be cool to implement tho if I had the time.

1 Like

I was thinking that you could’ve changed the body of the car to make it better, but as you mentioned it wasn’t even close to finished.

On that error, are you adding new animation tracks every time you move the controls? What does the animation script look like? Can you post some of that?

Because this is not complete, There are lots of code scraps and crap that I left out or still use. Sorry if it is tricky to abstract any useful info but yes, I was adding new tracks unfortunately.

AnimateOnCmd---------------------------------------------------------------
																											]]
--local Humanoid = plr.Character:FindFirstChild("Humanoid")
--local animator = Humanoid:WaitForChild("Animator")

--local SteerRight = animator:LoadAnimation(AnimationSteerRight)
--local SteerLeft = animator:LoadAnimation(AnimationSteerLeft)
--local RightFootGas = animator:LoadAnimation(Animationgas)
--local LeftFootBrake = animator:LoadAnimation(AnimationBrake)


script.Parent.Changed:Connect(function(drst)
--	if drst == "Steer" or drst == "Throttle" then
		
		if seat.Steer == 1 then
			local Humanoid = plr.Character:FindFirstChild("Humanoid")
			animator = Humanoid.Animator
			PLayItNow = animator:LoadAnimation(AnimationSteerRight)
			PLayItNow:Play()
		elseif seat.Steer == -1 then
			local Humanoid = plr.Character:FindFirstChild("Humanoid")
			animator = Humanoid.Animator
			PLayItNow = animator:LoadAnimation(AnimationSteerLeft)
			PLayItNow:Play()
		elseif seat.Steer == 0 then 
			if PLayItNow == nil then return false end
			PLayItNow:Stop()
		end
		
		
		if seat.Throttle == 1 then
			exausteffect.Fire.Enabled = true
			WheelSmokeL.Smoke.Enabled = true
			WheelSmokeR.Smoke.Enabled = true
			
			local Humanoid = plr.Character:FindFirstChild("Humanoid")
			animator = Humanoid.Animator
			LegAnimation = animator:LoadAnimation(Animationgas)
			LegAnimation:Play()
			
		elseif seat.Throttle == -1 then
			smokeffects()
			
			local Humanoid = plr.Character:FindFirstChild("Humanoid")
			animator = Humanoid.Animator
			LegAnimation = animator:LoadAnimation(AnimationBrake)
			LegAnimation:Play()
			
		elseif seat.Throttle == 0 then
			smokeffects()
			if LegAnimation == nil then return end
			LegAnimation:Stop()
		end
		
--	end
end)

Yeah I don’t think you’re using that correctly. You should be loading these in one time then just playing the animation track as needed:

local animationTrack = humanoid:LoadAnimation(animation)
animationTrack:Play()

You are making a new animation track in the humanoid every time they steer, many times per second probably.

Thanks. I will try that after i wake up. Its literally 2 in the morning in the UK. Once I am done I will mark your post as a solution.

1 Like