TrussParts do not render correctly in a ViewportFrame

Reproduction Steps

  1. Create a new ScreenGui inside the StarterGui folder.
  2. Insert a LocalScript into the new screen GUI object.
  3. Inside the script, paste the following code:
local viewportFrame = Instance.new("ViewportFrame")
viewportFrame.Size = UDim2.new(0.3, 0, 0.4, 0)
viewportFrame.Position = UDim2.new(0, 15, 0, 15)
viewportFrame.BackgroundColor3 = Color3.new(0, 0, 0)
viewportFrame.BorderColor3 = Color3.new(0.6, 0.5, 0.4)
viewportFrame.BorderSizePixel = 2
viewportFrame.BackgroundTransparency = 0.25
viewportFrame.Parent = script.Parent

local part = Instance.new("TrussPart")
part.Material = Enum.Material.Concrete
part.Color = Color3.new(0.25, 0.75, 1)
part.Position = Vector3.new(0, 0, 0)
part.Parent = viewportFrame

local viewportCamera = Instance.new("Camera")
viewportFrame.CurrentCamera = viewportCamera
viewportCamera.Parent = viewportFrame

viewportCamera.CFrame = CFrame.new(Vector3.new(0, 4, 6), part.Position)

Expected Behavior
The TrussPart should be visible, just like the part shown below:

Untitled1

(I created this by simply changing: local part = Instance.new("TrussPart") to local part = Instance.new("Part").

Actual Behavior
The TrussPart does not render, seen below:

Untitled2

I’ve also had reports of the Truss being rendered weirdly. Visually it looks similar to how things render when very far away from world origin and experience floating point errors. Here is an example sent to me by a player in my game, Obby Creator:

Issue Area: Engine
Issue Type: Display
Impact: Low
Frequency: Constantly
Date First Experienced: 2022-01-25 22:01:00 (+00:00)

6 Likes

Could reproduce this, even in your game.

3 Likes

Perhaps this is related. The behavior I’m seeing with a truss in a ViewportFrame (with no humanoid like the below thread) is very similar, except it also deforms the bounds of the frame.

1 Like

Yes looks like it could be!

Players also reporting some weird part rendering glitches that look kinda similar to that post. Though these are actual physical parts rather than parts within a ViewportFrame, so a little strange to me. Not sure if it’s related.

1 Like

Maybe it didn’t have to do with the truss but had to do with that specific viewportframe. Have you tried rendering other objects into it?

Also here is another post which has a problem similar to yours and it has a solution, maybe this will help: Viewportframe not rendering object

Hello. It doesn’t reproduce for me. Does it still happen to you?
image (1)

Appears to have been fixed at some point.

1 Like

Yes, it seems to have fixed itself a few days after I made this post. I forgot to update the solution. Thanks anyway!

2 Likes