Hello. I’m currently working on a ski system that uses VectorForces for movement, and I have all of the boxes checked, except for one.
Whenever I go to turn and hold W, it turns and updates the position of the VectorForce. However if I try to turn while not holding W, I don’t end up turning. The end result that I am looking to achieve is being able to turn while not holding W and heading in the direction that the player is facing after the turn.
The solutions that I have tried haven’t worked so far, and I’m wondering if anybody has any input as to how I can fix this problem.
This is a slope that I’m using for testing. The Red Line is what I want to accomplish, being able to turn sideways across the hill and not slide down it. The Blue Line is what ends up happening. The ball is heading down the fall line no matter which way I turn.
https://gyazo.com/d868883c55a170141e3158cde70a0441
Here’s the code that I’m using.
mouse.KeyDown:connect(function(key)
if key == "w" then
if DoesHaveSkis == true then
Loop = true
repeat
character.LowerTorso.Ski.VectorForce.Force = Vector3.new(1*multiplier,-0, 2*multiplier) * character.LowerTorso.CFrame.LookVector
wait(0.1)
until Loop == false
end
end
end)
mouse.KeyUp:connect(function(key)
if key == "w" then
if DoesHaveSkis == true then
Loop = false
character.LowerTorso.Ski.CustomPhysicalProperties = PhysicalProperties.new(0.7,0.1,0.5)
character.LowerTorso.Ski.VectorForce.Force = Vector3.new(0,-0, 0) * character.LowerTorso.CFrame.LookVector
end
end
end)
mouse.KeyDown:connect(function(key)
if key == "s" then
if DoesHaveSkis == true then
character.LowerTorso.Ski.CustomPhysicalProperties = PhysicalProperties.new(0.7,1.5,0.5)
character.LowerTorso.Ski.VectorForce.Force = Vector3.new(0,-0,0)
end
end
end)
mouse.KeyUp:connect(function(key)
if key == "s" then
if DoesHaveSkis == true then
character.LowerTorso.Ski.CustomPhysicalProperties = PhysicalProperties.new(0.7,0.1,0.5)
character.LowerTorso.Ski.VectorForce.Force = Vector3.new(0,-0, 0) * character.LowerTorso.CFrame.LookVector
end
end
end)
mouse.KeyDown:connect(function(key)
if key == "a" then
if DoesHaveSkis == true then
LoopTurn = true
repeat
character.LowerTorso.Ski.BodyAngularVelocity.AngularVelocity = Vector3.new(0,math.rad(225),0)
--UpdateVector()
wait()
until LoopTurn == false
end
end
end)
mouse.KeyUp:connect(function(key)
if key == "a" then
if DoesHaveSkis == true then
LoopTurn = false
character.LowerTorso.Ski.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0,0)
character.LowerTorso.Ski.VectorForce.Force = Vector3.new(character.LowerTorso.Ski.VectorForce.Force.X, -0, character.LowerTorso.Ski.VectorForce.Force.Z) * character.LowerTorso.Ski.CFrame.LookVector
--UpdateVector()
end
end
end)
mouse.KeyDown:connect(function(key)
if key == "d" then
if DoesHaveSkis == true then
LoopTurn = true
repeat
character.LowerTorso.Ski.BodyAngularVelocity.AngularVelocity = Vector3.new(0,math.rad(-225),0)
--UpdateVector()
wait()
until LoopTurn == false
end
end
end)
mouse.KeyUp:connect(function(key)
if key == "d" then
if DoesHaveSkis == true then
LoopTurn = false
character.LowerTorso.Ski.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0,0)
character.LowerTorso.Ski.VectorForce.Force = Vector3.new(character.LowerTorso.Ski.VectorForce.Force.X, -0, character.LowerTorso.Ski.VectorForce.Force.Z) * character.LowerTorso.Ski.CFrame.LookVector
--UpdateVector()
end
end
end)
Any help would be greatly appreciated.
Thanks.