VectorForce causing bicycle to spin in circles

I’m trying to create an accelerating bicycle using a VectorForce. However, when it is applied, my bike spins around in circles. If anyone could advise me on how to properly apply this force, or of an alternative method instead of a VectorForce to achieve an accelerating bicycle, that would be greatly appreciated. I don’t need to turn the bike for it to start spinning in circles

I have a VehicleSeat in the center of which this VectorForce is parented and applied to. ApplyToCenterOfMass = true

function UpdateVehicle()
	local force = 5000
	
	if seat.Throttle == 1 and carRunning then
		vectorForce.Force = Vector3.new(force, 0, 0) -- apply force if throttle = 1, ie player is moving forward
	elseif seat.Throttle == -1 and carRunning then
		vectorForce.Force = Vector3.new(-force, 0, 0) -- the opposite for reversing
	else
		vectorForce.Force = Vector3.new(0, 0, 0) -- stop the bike
	end
end

Also, I’m not too sure if I need to change the direction of the force when the player turns the bike, since it appears the force is always applied on the x-axis.

Maybe body gyro or the new version, align rotation?

1 Like

Ok, though How would I apply this?

Still having issues with this. Would appreciate if anyone else could help. I’ve tried using AlignPosition and the same issue occurs. It could be because the force is not on center, causing it to rotate?

As I can see from the video, the rear wheel seems to be almost blocked (not spinning), this is probably what causes the bicycle to spin in circles

Oh yes. I don’t know how to fix this. I am applying a VectorForce to the VehicleSeat and I don’t know what I should do to make it spin properly. It’s weird that the front one works fine though

Perhaps it’s colliding with something when spinning?

Could be, but how could I tell?

Put this script inside the wheel

script.Parent.Touched:Connect(function(Hit)
	print(Hit:GetFullName())
end)

It will tell you what the wheel is colliding with, and then you can add no collision constraints between the wheel and the parts that are stopping the wheel from spinning

Interesting. It seems to be colliding with the Baseplate, which is weird since it is at the same Y value as the front wheel

Hm, ok in that case in the top left corner press file, studio settings, physics, then scroll down and turn on “Are Contact Points Shown” option, it will allow you to see where the wheel is colliding

1 Like


Looks the same as the front wheel

Did you turn off the wheel meshes can collide property?

Yes, the Wheel itself is a sphere, and the wheels parts inside it all have CanCollide off.

In that case the problem is probably not occuring because of collisions, is your rear hinge’s actuator type property set to motor or servo?

Don’t know whats going on here, I moved this part at the back slightly to the left since it was touching the tyre and now its acting different


It’s selected as servo, so is the front

Try setting ActuatorType of both wheels to None

Still does the same thing, doesn’t appear to work

Try moving that part back to where it was, since before it seems like nothing has been touching the wheel