Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Using LookVector on Roblox Body Force with Script?

Asked by 5 years ago

Hello, I've been working on a raycasting car and I'm having an error with using look Vector to move the object in the direction that it is facing.

The current code I have is the following:

car.Engine.ThrustPoint.BodyForce.Force = car.Engine.ThrustPoint.CFrame.lookVector * 
stats.Speed.Value * 500 
car.Engine.ThrustPoint.BodyForce.Force = Vector3.new(car.Engine.ThrustPoint.BodyForce.Force.X, 0, car.Engine.ThrustPoint.BodyForce.Force.Z)

The car has a movement vector 2 that uses Movement.Y and Movement.X. The car has a thrust point that contains a body force.

This seems to move the object, but sometimes it gets out of hand and sends the car flying away. I've tried to stop it, but I can't figure it out. Once the car goes, it doesn't stop. Once the car get's going it also does not want to turn, the car body turns like it should, but the cars movement does not change like it should.

I also read that this does not work the same as other things on Roblox, and multiplications signs do not actually multiply, but I have not been able to find this online on any forum or article.

If you know anything that could help me with anything I have stated above, posting an answer is appreciated. Even if you do not know the answer, a guess is also appreciated, Thank you.

Answer this question