StarterCharacter wont align with slope in starter but works in workspace

noting that im a beginner so im quite slow
comparison


where its placed:
Screenshot 2024-08-10 124420
the script:

local wedge = script.Parent

local randomAxis = Vector3.new(1,0,0) -- Read this in the EgoMoose article

local DOWN = -Vector3.new(0,500,0)

local function getRotationBetween(u, v, axis)
	local dot, uxv = u:Dot(v), u:Cross(v)
	if (dot < -0.99999) then return CFrame.fromAxisAngle(axis, math.pi) end
	return CFrame.new(0, 0, 0, uxv.x, uxv.y, uxv.z, 1 + dot)
end


while true do
	local dt = wait()

	local rayResult = workspace:Raycast(wedge.Position,-1000*wedge.CFrame.UpVector)
	if rayResult then
		local rotateToFloorCFrame = getRotationBetween(wedge.CFrame.UpVector,rayResult.Normal,randomAxis)
		local goalCF = rotateToFloorCFrame*wedge.CFrame
		wedge.CFrame = wedge.CFrame:Lerp(goalCF,5*dt).Rotation +wedge.CFrame.Position
	end
end

I noticed where that script came from haha.

As for the problem its either humanoid forces stopping it so you need to disable that through PlatformStand or other method.

Or its Network ownership as its a server script but the client is the one in control.

You should try looking into both of those before responding.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.