I am using a vector force to control a hoverboard in a game I’m making.
Here are the parts where the force is initialized, and where I change the force.
force = Instance.new('VectorForce')
force.Name = 'Mover'
force.Parent = hrp
local attachment = Instance.new('Attachment', hrp)
force.Attachment0 = attachment
force.ApplyAtCenterOfMass = true
force.Force = Vector3.new()
the part where I change the force is inside of a renderstepped function
local forceDirection = hrp.CFrame.LookVector
forceDirection = forceDirection * speed
force.Force = Vector3.new(math.abs(forceDirection.X), 0, math.abs(forceDirection.Y))
I added abs because it seemed to be backward at some points, and abs did actually help a lot, but the force just doesn’t want to follow the frame of the hrp. Im really a beginner when it comes to cframe and vectors so any help would be great. Thanks.