Hello!
So I tried making a 2D platformer earlier this week. In this game you are a cube which is doing platform jumps and such. The cube is being moved around using BodyVelociy. Everything went smooth, but there is this huge issue. Whenever I move the cube for more than a few times, or whenever the cube spins way too much this happens:
https://gyazo.com/89d2f7aaacd8a1f2df6d2554b2024200
https://gyazo.com/5980126df0e7855fcc6617aa941f02ae
As you can probably see the movement becomes very clumsy.
This is what I use to move the cube:
if Action == "Jump" then
cube["Jump Velocity"].MaxForce = Vector3.new(0, 10000, 0)
cube["Jump Velocity"].Velocity = Vector3.new(0, 40, 0)
wait(0.1)
cube["Jump Velocity"].Velocity = Vector3.new(0, 0, 0)
cube["Jump Velocity"].MaxForce = Vector3.new(0, 0, 0)
elseif Action == "Left" then
cube["Moving Velocity"].MaxForce = Vector3.new(1000, 0, 0)
cube["Moving Velocity"].Velocity = Vector3.new(-15, 0, 0)
elseif Action == "Right" then
cube["Moving Velocity"].MaxForce = Vector3.new(1000, 0, 0)
cube["Moving Velocity"].Velocity = Vector3.new(15, 0, 0)
elseif Action == "Stop Moving" then
cube["Moving Velocity"].MaxForce = Vector3.new(0, 0, 0)
cube["Moving Velocity"].Velocity = Vector3.new(0, 0, 0)
end
I tried making it so the cube doesn’t rotate with the following code:
script.Parent.Orientation = Vector3.new(0, 0, 0)
The cube doesn’t rotate when I write this, but the issue still happens.