Hi, So I am making a space oriented game where the ship moves in 3 directions: forward left and right. (turning not possible) Basically similar to the 2018 egg hunt game speedlands. I have the following code:
local steer = script.Parent.Parent.Forcearea.BodySteer
local Seat = script.Parent
local steerspot = CFrame.new()
local forcebrick = script.Parent.Parent.Forcearea
Seat.Changed:Connect(function(move)
if move == "ThrottleFloat" then
movement.Force = Vector3.new(0,0,-400000 * Seat.ThrottleFloat)
if Seat.ThrottleFloat < 0 then
movement.Force = Vector3.new(0,0,-300000 * Seat.ThrottleFloat)
end
else
movement.Force = Vector3.new(0,0,-100000 * Seat.ThrottleFloat)
end
if move == "SteerFloat" then
steer.Force = Vector3.new(100000*Seat.SteerFloat,0,0)
steerspot.Position = Vector3.new(forcebrick.Position)
end
end)
I’m setting Cframes so that I can use a bodyposition to dampen steering movements since there is no on-ground friction. However this code is giving me the error: Position cannot be assigned to: on this line
steerspot.Position = Vector3.new(forcebrick.Position)
Would be appreciated if someone leads me in the right direction to solve the issue.
Thanks,