After looking countless times on both the Toolbox, DevForum and other sources, despite the fear posts such as this one had given me, it’s time to face my horror and attempt to make a proper 3rd Person Smooth Camera from scratch.
My big problem: I have no idea what to do.
I’m completely blank. I don’t know how to read the Camera’s coordinates properly, I’m unsure on how I should be force setting them and even if I go past all this I don’t see any way I could make this without turning the game very unresponsive, with tons of delay from actual mouse movement and camera response.
Any resources, ideas or whatever I should try to get this somewhere?
Really anything helps, I know as much about Camera Manipulation as I know about the Tango.
Hi. I’d personally suggest reading around the use of springs.
Trey Reynolds does a good brief overview of springs and how you could go about implementing them in this RDC panel:
The bit you’re interested in is around 23:20.
Here is an open-sourced module you can use to model a spring. Spring.lua (3.2 KB)
A snippet of code that might help you get started:
local spring = Spring.new(Vector3.new()) -- create a new spring
--[[
setting the properties of spring
dampening:
- higher values means the spring will behave more "elastic-like", much like the EasingStyle
'Elastic': https://developer.roblox.com/en-us/api-reference/enum/EasingStyle
speed:
- higher values means the spring will reach its target in a shorter amount of time,
therefore will be more responsive.
--]]
spring.dampening = some_value
spring.speed = some_val
-- do logic with spring - run every frame
local function SomeCameraFunction()
spring.target = currentCameraPosition
local newCameraPosition = spring.position
return camera.CFrame = CFrame.new(newCameraPosition)
end