can anyone help me? Im guessing its a setting i have to change on the humanoid but im not sure what one.
I'm trying to have a placeable npc that will do custom emotes and talk e.g
this is the code i use for the display of part before i place it as shown in the video
local isBuilding = false
local currentRenderConnection = nil
local previewModel = nil
local function toggleBuildMode()
isBuilding = not isBuilding
if isBuilding and activeModelTemplate then
previewModel = activeModelTemplate:Clone()
previewModel.Parent = workspace
for _, part in pairs(previewModel:GetDescendants()) do
if part:IsA("BasePart") then
part.CanCollide = false
part.Anchored = true
part.Transparency = 0.5
part.CastShadow = false
elseif part:IsA("Decal") or part:IsA("Texture") then
part.Transparency = 0.5
end
end
currentRenderConnection = RunService.RenderStepped:Connect(function()
if previewModel and placement then
local cf = placement:CalcPlacementCFrame(previewModel, mouse.Hit.p, 0)
previewModel:SetPrimaryPartCFrame(cf)
local colliding = placement:isColliding(previewModel)
local previewColor = colliding and Color3.new(1, 0, 0) or Color3.new(0, 1, 0)
for _, part in pairs(previewModel:GetDescendants()) do
if part:IsA("BasePart") then
part.Color = previewColor
end
end
end
end)
else
if currentRenderConnection then
currentRenderConnection:Disconnect()
currentRenderConnection = nil
end
if previewModel then
previewModel:Destroy()
previewModel = nil
end
end
end```