of     1   

Valyrian_Advisor
#216526409Saturday, May 13, 2017 9:22 AM GMT

Hello, I have a problem with the ship I'm scripting. Basically, when the player holds "W" or "S" a value called "Velocity" changes, and the speed of the ship will be: Body.BodyVelocity.Velocity = Body.CFrame.lookVector * velocity.Value My problem is that sometimes, when I turn the ship and then stop turning, my ship doesn't go exactly forward(sometimes the force is something like 45° from the front!). I don't know what's wrong, I tried changing the BodyVelocity when the ship stopped turning, I also tried changing the BodyVelocity with a while true loop every 0.5 secs(just to test), but still, the ship doesn't go always forward after I turn. What am I doing wrong?
hunxrepair
#216526652Saturday, May 13, 2017 9:34 AM GMT

Can I see the ship?
Valyrian_Advisor
#216526874Saturday, May 13, 2017 9:45 AM GMT

That's the part I have a problem on. Even if I loop the velocity every 0.5 seconds in another script, it "slides" on the water and doesn't go forward.
Klocko
#216527037Saturday, May 13, 2017 9:53 AM GMT

Are you updating the velocity correctly? The lookVector changes with the rotation. I suggest storing the state of W and S and then updating the velocity every frame by connecting a function to RunService.Heartbeat. #####################################################################
Klocko
#216527048Saturday, May 13, 2017 9:53 AM GMT

That was meant to be a wiki link, but I guess it's gone now.
Valyrian_Advisor
#216527069Saturday, May 13, 2017 9:54 AM GMT

The BodyVelocity updates alredy, but not in the right direction, not exactly on the lookvector.
Disillusions
#216527078Saturday, May 13, 2017 9:55 AM GMT

Check if the front surface is facing the right way.
Valyrian_Advisor
#216527090Saturday, May 13, 2017 9:56 AM GMT

How would I do that?
cntkillme
#216527143Saturday, May 13, 2017 9:58 AM GMT

well make sure the front surface of the body is pointing exactly in the forward direction
Valyrian_Advisor
#216527199Saturday, May 13, 2017 10:00 AM GMT

Well if that's what you mean, I am 100% sure that the Front face is looking forward, so the lookvector should be fine, I don't get what's the problem.
hunxrepair
#216527385Saturday, May 13, 2017 10:09 AM GMT

I recommend using a BodyGyro to control the direction, and a BodyVelocity to control the speed
hunxrepair
#216527419Saturday, May 13, 2017 10:11 AM GMT

Gyro.CFrame = CFrame.new(Body.Position, Body.CFrame.lookVector * 10) Velocity.MaxForce = Vector3.new(10000,10000,10000)

    of     1