Self explanatory via the title, my goal is to find randomization in spinning so that the ring of the ball that you can see in the gyazo I will show you has some skillset in it.
If you want this sort of smooth effect, you should use some kind of Spring library to achieve the movement goal in a way where it is interpolated nicely.
A good library for this kind of work is spr by Fractality - you would set the rotation goal randomly (via CFrame.Angles(randX, randY, randZ) and then use the spring library to go to that goal. This will mean it will not suddenly move, and instead will interpolate the target change in the way you want.
Sure - here is some pseudocode I drew up for how you might want to do this. I can’t write the thing for you but hope it helps.
local spr = require(script.spr) -- spr module
local Ball = workspace.Ball -- The ball you want to rotate
local Rand = Random.new(os.time()) -- The random number generator, seeded properly
while wait(RandNextNumber(1,3)) do
spr.target(Ball, 1, 1, { -- Change the goal orientation
Orientation = Vector3.new(
Rand:NextNumber(0,360),
Rand:NextNumber(0,360),
Rand:NextNumber(0,360)
)
})
end
RandNextNumber is not a feature that comes with lua itself, but math.random is.
local spr = require(script.spr)
local Ball = workspace.Ball
local Rand = Random.new(os.time())
while wait(math.random(1,3)) do
spr.target(Ball, 1, 1, {
Orientation = Vector3.new(
Rand:NextNumber(0,360),
Rand:NextNumber(0,360),
Rand:NextNumber(0,360)
)
})
end