BillboardGUIs Delayed

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

  1. 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.

  1. 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 )
image

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

2 Likes

Heh… I’m not gonna read all of the code. This is happening because you’re teleporting those parts with the billboards instead of welding them together. So try using a weld constraint. Hope this helps! :happy1: Goodluck!

Oh and by the way: nice gun!

2 Likes

Thanks for the reply, uh

If the parts that you’re talking about are the Adornees of the billboard, then that isn’t the solution. Those parts were already welded to the gun. Everything else in the ViewModel should also be properly welded as well. The root of the ViewModel is also Anchored so it couldn’t be that either.

The examples shown on the first video is just placed as a neat display on what it should look like

2 Likes

You didn’t bother reading everything and incorrectly assumed what the problem was.

The billboard GUIs are adorned to the clients parts. There is no slowly moving hover parts.

1 Like

I meant with weld constraints but okay. I guess I couldn’t help you. I’m sorry. :sad:

1 Like

Yeah I didn’t read all that. :woozy_face:

1 Like

Don’t worry, I’m not expecting a simple fix, I’ve already searched elsewhere but they found workarounds such as using a surface GUI instead of a billboard

Anyways, here’s me using Weld Constraints

1 Like

Oh, well my bad… Sorry. :sad:

30char

1 Like

I’ve used Attachments before where the WorldPosition property was used. Could this be a solution? If not, let me know and I will take a deeper look.

1 Like

BillboardUIs have to use scale to stay the same position no matter distance.

although about them being delayed, it maybe is something to do with your renderstepped for the viewmodel?

maybe you can try this??

runService.RenderStepped:Connect(function(deltaTime:number)
spawn(function()
	--// 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)
end)
1 Like

Thanks for the response

I tried encapsulating everything with a spawn function as you suggested, however, it made this error which is very similar to what happens if I switch the render function to Heartbeat or Stepped

I think it is because a delay for spawn function, and the reason the bill board ui is delay is beacuse renderstepped, so I’m not sure how to fix this.

I also tried on my gun system and it was delayed too

1 Like

Thanks for trying to help, if you find a way to fix your gun system’s issue, then, please tell me the fix

1 Like

I’m assuming you meant using attachments as a reference when you mentioned using WorldSpace.

This video is me using attachments as Adornees for the billboard

And this video is me using StudsOffWorldSpace and WorldPosition

Neither solved the issue.