Hello. I have an issue where whenever I decide to rotate or manipulate C0 joints in the character Motor6Ds, inverse kinematics apply for some strange reason.
I don’t believe it is an issue with the script itself, I’ve encountered this in multiple scenarios, with different types of scripts and goals.
You have to set the C0 property of the HumanoidRootPart to CFrame.new(). CFrame is a function that takes 6 arguments, position, rotation and scale. CFrame.new(0,-1,0,1,0,0,0,1,0,0,0,1) is setting the position to Vector3.new(0, -1, 0), the rotation to CFrame.Angles(0, 0, 0) and the scale to Vector3.new(1, 1, 1). If you want to set the rotation, use CFrame.Angles(). CFrame.new(0, -1, 0) * CFrame.Angles(0, 0, -vector.x) would apply the rotation to the current rotation, instead of replacing it.
Your onStepIn event is firing multiple times, on each tile of the staircase.
You can add a simple condition to check if the player is already on the staircase, and only teleport him if he’s not:
function onStepIn(cid, item, pos)
if isInArray({1, 2, 3, 4}, isPlayer(cid)) then
doTeleportThing(cid, {x=32844, y=32333, z=7})
end
return true
end
Oh yeah if this doesn’t help, mind giving me the code?
I am not using a function like that, as I’ve mentioned, I don’t believe this is a problem with the script itself.
I believe this is a feature I have to disable, by code or by studio, I am not sure. Either way. If it is to help understand, here’s the script:
RunService.Heartbeat:Connect(function()
local Result = workspace:Raycast(RootPart.Position, Vector3.new(0, -Character.Humanoid.HipHeight - (RootPart.Size.Y / 2) - 2, 0), rayParams)
local Normal = Result.Normal
if Result then
local Vector = RootPart.CFrame:VectorToObjectSpace(Normal)
TweenService:Create(LowerTorso.Root, TweenInfo.new(0.15), {
C0 = CFrame.new(0,-1,0,1,0,0,0,1,0,0,0,1) * CFrame.Angles(Vector.Z, 0, -Vector.X)
}):Play()
end
end)