Hello.
Working on that Ski Engine that I’m using, I have got a few issues that I am stuck on.
First issue is regarding Animations. Because of the way the system works, I have to find a way to disable the player default animations while the skis are equipped. I already tried disabling the Animation Script, and all that does is seem to break the animations after I enable it.
Second issue happens to be with the Rotation controller, which allows the skis to orient to the terrain when pointing down, and orient straight up and down when going sideways across a hill. My only issue with this is that while turning at high speeds, the script seems to drift and eventually result in my character not facing straight up and down when the terrain is flat.
Here’s the script for that
local RunService = game:GetService("RunService")
local Character2 = script.Parent
local HumanoidRootPart = Character2:WaitForChild("HumanoidRootPart")
local LowerTorso = Character2:WaitForChild("LowerTorso")
local Root = LowerTorso:WaitForChild("Root")
local C1 = Root.C1
local RayParams = RaycastParams.new()
RayParams.FilterDescendantsInstances = {Character2}
RunService.Heartbeat:Connect(function()
local RaycastResult = workspace:Raycast(LowerTorso.SkiGroup.LookToGround.Position,Vector3.new(0,-3, 0), RayParams)
if RaycastResult then
local pitch = math.asin(-RaycastResult.Normal:Cross(HumanoidRootPart.CFrame.rightVector).Y);
Root.C1 = C1 * CFrame.Angles(pitch , 0, 0)
else
Root.C1 = C1
end
end)
The last issue I have is finding a way to limit the speed of the character, because right now there is no way to limit the speed.
Any help is greatly appreciated, If I should clarify something above, let me know.
Thanks.