Problems witha boat script

I have a boat script that worked well until some mins ago, I dont know what im doing wrong to get this:
image
Script:

local Engine = script.Parent.Parent.Parent.Float.Velocity
local SForce = script.Parent.Parent.Parent.Float.BodyAngularVelocity
local DSeat = script.Parent 

local speed = 500
local SteerSpeed = 150


DSeat.Changed:Connect(function(p)
	if p == "ThrottleFloat"then
		Engine.Force = Vector3.new(0,0,speed * DSeat.ThrottleFloat)
	end
	if p == "SteerFloat"then
		SForce.AngularVelocity = Vector3.new(0,-SteerSpeed*DSeat.SteerFloat,0)
	end
end)


Thanks for reading!

The error indicates that the Force property is read-only, and you’re trying to modify a read-only property.

1 Like

But it worked before, why does it not work now?

According to the wiki its not a read-only property

1 Like

My bad, another guess is that the error could indicate that the variable Engine is a different value than you expected, test if Engine == script.Parent.Parent.Parent.Float.Velocity returns true (whether by assert or print), is the line it errored here?

Engine.Force = Vector3.new(0,0,speed * DSeat.ThrottleFloat)

Is the Engine variable changed somewhere in your script? That might be the problem, but this is just my guess.

1 Like

Okay I just figured it out. For some reasn I referenced Velocity and its a bodythrust :joy: