So I’m currently writing a system where a car has to fade in from the foreground using transparency. It doesn’t have to be perfect, however the mesh seems to not be loading in as the car reaches it’s final transparency. https://gyazo.com/16973103e76f5258d42448bf16133495
Here in the clip the car loads in after the transparency is finished, making it look snappy. (Keep in mind the ui isn’t finished yet so it may look a little bare bones on this menu page)
Here is my code for this section, I’ve tried using :PreloadAsync() to assist the meshes in loading, but to no avail.
if spinConnection then spinConnection:Disconnect() end
LoadedCar:ClearAllChildren()
rotation = 82
local newModel = databaseEntry.Model:Clone()
newModel.Parent = LoadedCar
local LoadTargets = newModel:GetDescendants()
ContentProvider:PreloadAsync(LoadTargets, function(asset)
print(asset)
end)
PositionVal.Value = newModel.Primary.Position
WeldToPrimary(newModel)
TweenService:Create(PositionVal, tweenInfo, {Value = databaseEntry.EndPosition}):Play()
for _, part in newModel:GetDescendants() do
if part == newModel.Primary then continue end
if not part:IsA("Part") and not part:IsA("MeshPart") then continue end
local TargetTransparency = databaseEntry.TransparencyTargets[part.Name] and databaseEntry.TransparencyTargets[part.Name] or 0
TweenService:Create(part, tweenInfo, {Transparency = TargetTransparency}):Play()
end
spinConnection = RunService.RenderStepped:Connect(function(dt)
rotation -= 20*dt
newModel.Primary.CFrame = CFrame.new(PositionVal.Value) * CFrame.fromOrientation(0, math.rad(rotation), 0)
end)
It’s probably due to the fact that having transparent Parts behind other Transparent Parts (or Meshes) has always been an issue with Roblox Rendering.
Would it be possible to make a single mesh display car that fades in then Parent the actual Model to the Workspace at the end CFramed at the same location?
But what I mean is to use the mesh car only for the visual effect. If it’s a single MeshPart then the overlapping transparency wouldn’t be a factor.
Rotate it, tilt it, do whatever you want while the loading in animation part of the script runs, then when it’s Transparency 0 and stops in its final Position switch it for the actual car model.
Yes, I get that, but the way the car is meant to be structured (even from a visual standpoint) its not meant to be just one single mesh. It’s how the cars were modelled.