How can I attach my SurfaceGui to the Camera?

Hello I made a SurfaceGui but I don’t know how to attach it to the camera
Screenshot_2747

How can I attach my SurfaceGui to the camera like this?:

Thanks

1 Like

Hey! Cool looking game.

Although I have never done this before, but have seen it, I think you have to do something involving getting workspace.CurrentCamera.CFrame, and using some Tween/Lerp to put the part in front of it.

Be warned though, this is very inefficient, and it’s also not the best for performance. I would suggest just making it a ScreenGui instead.

Please also describe better what you are trying to do in your post, as I was unsure what you were trying to do at first.

4 Likes

This just popped into my head, are you trying to make that cool depth effect with the guis?

3 Likes

Yeah actually we are making a new game like Tom Clancy’s The Division 2, we are also having trouble doing some things because we are just starting to learn the Lua.

We want to make SurfaceGui just like in the video, but your thoughts about performance got me a little.

With ScreenGui, it will be more efficient, but it does not seem to have an effect like in the video.
I’m a little confused

From the video, it looks like they are doing what I just described, but it looks really choppy/clunky, so I think they slowed down the amount of tweening/lerping its doing so that it works well, which is something you can easily do. Plus I’m assuming you are running on the local player, so you shouldn’t have to worry too much about performance, only if your game is for PC/Xbox. (I’m assuming it is because most shooters are hard to make for mobile/tablet)

2 Likes

Alright, thanks to you, we are one step closer to our goals.
Have a nice day and take care!

2 Likes