Billboard GUIs in my game are not working as intended, they are both delayed and their sizing is off.
Here are the billboards in question
How it SHOULD act
How it’s acting ( Size is also wrong )
Here’s the issues that I have with them
- The billboards are delayed. I have tried multiple ways to try and circumnavigate this issue.
I tried to use StudsOffsetWorldSpace to try and fix it, however, it has the same behavior as either parenting the billboard to a BasePart or setting it’s Adornee to a BasePart. I’ve also tried to change the stepped function that my script uses from RenderStepped to PreRender, Stepped, HeartBeat, and PreAnimation, all of which does solve the issue, but create issues with my ViewModel.
- The size of the billboards does not match their proper size.
The size of the BillBoards use Offsets for their size, however, it does not act accordingly. I have no idea where to start on fixing this
Image of Billboards are using fromOffset and using StudsOffsetWorldSpace ( current attempt to fix it’s delay )
I suspect that the issue has something to do with how my ViewModel works. Below is a trimmed-down version of the code that I use for my ViewModel.
runService.RenderStepped:Connect(function(deltaTime:number)
--// Step 1
hrp.CFrame = CFrame.new(hrp.Position,hrp.Position + (camera.CFrame.LookVector - Vector3.new(0,camera.CFrame.LookVector.Y,0)))
--// Step 2
local localOffset = camera.Focus.Position - (head.Position + head.CFrame.LookVector * -1)
camera.CFrame = camera.CFrame + localOffset --hrp.CFrame:ToObjectSpace(CFrame.new( hrp.Position + localOffset )).Position
--// Bunch of code that adjust values in viewModelOffsets here //
--// Step 3
local offset = CFrame.new(0,0,0)
for i,cframe in pairs(viewModelOffsets) do --// viewModelOffsets is a table containing a bunch of CFrame values
offset = offset * cframe
end
viewModelRoot.CFrame = camera.CFrame * offset
--// Step 4
for i,billboard:BillboardGui in pairs(playerGui.AttachmentBillboardGui:GetChildren()) do
billboard.StudsOffsetWorldSpace = billboard.AttachmentSpot.Value.Position
end
end)
What it does is that it first ( step 1 ) makes it so the player’s HumanoidRootPart turns to the camera’s direction. Afterwards ( step 2 ), it then offsets the camera so it follows the player’s head. next ( step 3 ), it sets the CFrame of the ViewModel to be the camera’s CFrame with the addition of some offsets. Finally ( step 4 ), it sets the StudsOffsetWorldSpace of each billboard to their corresponding attachment spot’s Positions.
During my testing, I noticed that removing step 2 stops the sizing issue, however, the delay issue remains
Effects of removing step 2
Any help would be greatly appreciated