Basically, this ball script: https://youtu.be/HL-5ZLEL44g?si=cNXiH3NnOR7p9Il- the ball stops after x amount of time. I use basically the same system in my game just adjusted to my game but the same movement. How do i make it not lock. TLDR the ball script above in the vid stops the ball from spinning, how do i fix this
If you want to stop it from spinning, you could give a BodyAngularVelocity a small amount of torque and a desired velocity of 0. It will consistently attempt to bring the ball to a stop.
Yeah i can do that, ill post my script when i get home but the problem is im not sure where/why but at a certain point it just insta stops
here is its:
local cs = game:GetService("CollectionService")
while true do
task.wait()
for i,v in pairs(cs:GetTagged("Ball")) do
if v:IsA("Player") == false then
local char = v
local marble = char.HumanoidRootPart
marble.BodyAngularVelocity.AngularVelocity = Vector3.new(char.Humanoid.MoveDirection.z * 32,0,char.Humanoid.MoveDirection.x * -32)
marble.BodyAngularVelocity.MaxTorque = Vector3.new(30000,30000,30000)
print(marble.BodyAngularVelocity.AngularVelocity)
if char.Humanoid.MoveDirection == Vector3.new(0,0,0) then
marble.BodyAngularVelocity.MaxTorque = Vector3.new(65,65,65)
print(marble.BodyAngularVelocity.AngularVelocity)
end
end
end
for i,v in pairs(cs:GetTagged("Sticky")) do
if v:IsA("Player") == false then
local char = v
local marble = char.HumanoidRootPart
marble.BodyAngularVelocity.AngularVelocity = Vector3.new(char.Humanoid.MoveDirection.z * 32,0,char.Humanoid.MoveDirection.x * -32)
marble.BodyAngularVelocity.MaxTorque = Vector3.new(30000,30000,30000)
if char.Humanoid.MoveDirection == Vector3.new(0,0,0) then
marble.BodyAngularVelocity.MaxTorque = Vector3.new(65,65,65)
end
end
end
end
Figured it out, What i was looking for is EvaluateStateMachine in the humanoid! ty for the help @RoloTheDevBunny