infirmn
(infirmn)
February 2, 2024, 2:49pm
#1
hello there! im currently working on a gun system of my own for my game, i want the system to feel clean and polished so i wanted to make a nice camera effect for “recoil” where it jolts the players camera up and then a short second after go back down to its original position, how would i accomplish this?
thanks,
xordium
2 Likes
Lametta
(Lametta)
February 2, 2024, 2:52pm
#2
You can use Tweening to adjust the camera cframe at a desired angle and have it loop back to the normal position to create a recoil effect.
You can learn more about tweens here:
2 Likes
infirmn
(infirmn)
February 2, 2024, 2:53pm
#3
yeah, i have looked through that but so far i’ve only found position tweening, i dont think that would work for what im trying to achieve
Lametta
(Lametta)
February 2, 2024, 2:54pm
#4
Tweening can be done with most values. Instead of using Part.Position or Part.CFrame, you can use Camera.CFrame
infirmn
(infirmn)
February 2, 2024, 2:55pm
#5
how would it go back to the original camera angle?
Lametta
(Lametta)
February 2, 2024, 2:57pm
#6
Within your tween info you can set the option to bounce it back to true.
infirmn
(infirmn)
February 2, 2024, 2:58pm
#7
tweening confuses me, do i have to use the massive table every time?
1 Like
Lametta
(Lametta)
February 2, 2024, 3:00pm
#8
You only need to create it once and then you can call it whenever.
1 Like
infirmn
(infirmn)
February 2, 2024, 3:02pm
#9
all the examples are parts, how does it work with the camera?
Lametta
(Lametta)
February 2, 2024, 3:05pm
#10
Apologies for my laziness but this may be a useful article to your circumstance.
Hello. I’m trying to recreate the camera in the game Foxhole (If you haven’t heard of it search it up, it’s pretty cool). Anyways I’m trying to create the function to rotate the camera. All my current tries of adding CFrame.Angles(0,math.deg(45),0) to the new CFrame coordinate just makes the camera glitch. Anything to help would be appreciated.
My code
local Plr = game.Players.LocalPlayer
repeat wait()
until Plr.Character:FindFirstChild('Head')
local Camera = workspace.CurrentCamera
Camera.Ca…
infirmn
(infirmn)
February 2, 2024, 3:08pm
#11
it doesnt really help me as i dont understand tweening cameras that well… thanks though!
Use a pre-made resource: CameraService - A New Camera for a New Roblox
P.s. don’t ask me how to use it.
infirmn
(infirmn)
February 2, 2024, 3:29pm
#13
doesnt really help, i want to learn not to use a resource
Smojaa
(Smoja)
February 2, 2024, 3:31pm
#14
If you want to learn rather than using resources, i recommend learning tween service, it has a very broad use and is basically fundamental to any moving part within a game, they’re not that hard to understand once you have a play around with them for a few hours.
infirmn
(infirmn)
February 2, 2024, 3:32pm
#15
i am attempting too, just usually examples help me learn quicker thats all
Smojaa
(Smoja)
February 2, 2024, 3:34pm
#16
The camera has pretty much the same properties as parts when it comes to movement, just make sure the camera type is scriptable