Local Transparency Issues

So, I am trying to make my character appear in first person. I have tried many things but always run into one issue. Either for some reason the UpperTorso appears and then immediately disappears or I have problems trying to make the head and all possible attachments to it stay invisible. This must be dynamic and work for most custom character models.

Does anyone know my the UpperTorso is reappearing or how I might go about looking for all parts attached to the head of a model dynamically.

Here is what code I have for it now. This is what makes everything appear but the UpperTorso appears then disappears.

local player = game.Players.LocalPlayer
local char = player.Character
local RunService = game:GetService("RunService")


for i, v in pairs(char:GetChildren()) do
	if v:IsA("BasePart") and v.Name ~= "Head" then

		v:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
			v.LocalTransparencyModifier = v.Transparency
		end)

		v.LocalTransparencyModifier = v.Transparency

	end
end

i dont know the full solution but I’ll start with some basics and maybe that’ll help discover the issue

firstly, the modifier is not the transparency, it’s a differential. thus the ‘modifier’ in its name.

like if the part’s transparency is 1, and the local modifier is 0.5, the new transparency is 1.5 – effectively no change.

also, you’re changing the property you’re detecting change for within its connected function, you can have unexpected behavior if the value you’re assigning is different between your initial event and the response event (because it’ll do it once, then it’ll do it again because you assigned something new, and it wont do it a third time if the change is the same as the last entry. thus if its never the same then itll burn itself out). perhaps instead, given Roblox automatically likes to change the local transparency modifier on its own when in first person, index the parts into a table and iterate the table’s local transparency modifier every RenderStepped

To find parts connected to one-another, you can try GetConnectedParts() and provide the parameter as true so it’ll active recursively. It’ll find all parts connected by rigging (in Humanoid’s cases, motor6d’s)

Yeah GetConnectedParts is the function I was looking for thanks. Yeah that code isn’t mine. I was indexing threw the characters descendance and changing there LTM. But it would do the heads attachments still. I couldn’t figure out he to realistically get items that were attached too the head dynamically. So I was messing with this code I found…

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