Error in the "Build a car" tutorial

Hi all. I’m brand new to programming, so I was going through the “build a car” tutorial on defold to learn how collections and game objects work together. It was great, but I found an error in the “Drag to the Rescue” part of the script here: Building a simple car in Defold.

Instead of this line reading:

– Apply drag
self.acceleration = self.acceleration - speed * self.direction * drag

It should read:

– Apply drag
self.acceleration = self.acceleration - speed * self.velocity * drag

The final full car script at the end of the tutorial has this issue fixed, but it’s incorrect in the first part of the tutorial when we’re asked to copy the script the first time.

Just thought I would drop a line so future students don’t get tripped up like I did.

  • Defold Version [1.6.1]
2 Likes

Thanks. I’ve updated the tutorial. Update car.md · defold/doc@6864955 · GitHub

1 Like