What do you want to achieve? A slowly spinning object without errors
What is the issue? Spin errors on the cross-over from positive to negative
What solutions have you tried so far? I’ve made a spin every way I can think of
Same error is in each version or technique. This is just a script that can show you the error.
Is it possible to just spin an object flawlessly? I’m starting to question if it is …
local Break = false -- flag
local P, Y -- pause, vector
local v1 = Vector3.new(0, 0, 0)
local part = Instance.new("Part")
part.Name = "SpinTest"
part.Locked = true
part.Anchored = true
part.Position = Vector3.new(0,0,0)
part.Size = Vector3.new(10,10,10)
part.Material = Enum.Material.Brick
part.Shape = Enum.PartType.Ball
part.Parent = workspace
task.wait(2) -- pause
--
function Spin()
while true do task.wait(P)
v1 += Vector3.new(0, Y, 0)
--
if string.match(tostring(v1.Y),"e") then print("error") end
--
part.Orientation = v1
print(v1) -- each step
--
if Break == true then break end
end
end
--
P, Y = 1, 0 -- start the loop
task.spawn(function() Spin() end)
------------> TEST <------------
P, Y = 0.01, 0.01 -- clockwise
task.wait(2) print("reverse")
P, Y = 0.01, -0.01 -- counter
-- let run till past (0,0,0)
task.wait(2) -- pause for a bit
Break = true -- break the loop
-- check the print out ...
Script should be good to go, just pop it in the editor and give it a test.
Is there something I can do to fix this or is there a different type of spin technique.
(also: creating a hinged part will not work for how this is being used in the real program)
The reason this is a problem is you can clearly see a jitter due to this on the crossover. It don’t matter if you change direction or its just a simple one way spin. On the crossover it will jitter a bit.
This test is set up to get to the crossover quickly. So you can see the error without going all the way around.
“I’ve made a spin every way I can think of. Same error is in each version or technique.”
When it spins to the part it chages from a positive to a negative … I think there is a editor error.
(try the test and look at the print out … you’ll get a “e” value that makes a spin jitter)
I’m just looking to get a slow flawless spin … In my program, yes I will need to change directions.
It’s the slow part that seems to be getting me here. I’ve done it the way you stated … however I’m retesting that now. Looks like I tried .fromEulerAnglesXYZ and not rad() …
As I understand from your example, you want to get those values consistently, and you are considering the e- as an error, while that number expressed its 0.000000014901161193847656
So close but yet again you get a jitter when the rotaion reaches 0,0,0 as it moves forward.
Looking back on my notes, turns out I did try that technique on the 2nd attempt.
This was my 3rd attempt … sB.CFrame = sB.CFrame * CFrame.fromEulerAnglesXYZ(0, srB, 0)
This one jitters the less. But I can still see it.
Idk, but, honestly I see the sequence numbers very constant without “jumps”
Decreasing around 0.009999997913837433 each iteration, and visually I cant see the jitter, but maybe Im not paying enough attention.
I think so too … and even tried to go with a (0,0,0) switch at that point … It still jitters.
Try a few tests … The object I’m rotating is much larger and the jitter really sticks out.
I have a flawless rotaion right up till that point and after. In fact if you’re not looking right at it at that moment you will miss the jitter.
That video is terrible and makes it look junky … It’s actually a beauty and you get lost in the depth. Right up till the jitter >< … that Video looks like it’s all a constant jitter and very low res (from the editor). Probably would have never even noticed this if it wasn’t for how large this all is. You’re actually inside of it.
I was wrong, it is possible to get a perfect slow flawless rotaion … but, you need to use a local script.
It was a millisecond of random lag the whole time …