Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Added 3rd Person Camera #3

Open
wants to merge 3 commits into
base: dev/0.1.0
Choose a base branch
from
Open

Added 3rd Person Camera #3

wants to merge 3 commits into from

Conversation

jedck
Copy link

@jedck jedck commented Sep 27, 2018

No description provided.

lib/common/camera/3rd-Person.lua Outdated Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Outdated Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Outdated Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Outdated Show resolved Hide resolved
-- Generates the goalCFrame for tracking taget
local goalCFrame = CFrame.new(target.Position) -- The position of the target
* CFrame.Angles( -- Rotated by the target
math.rad(target.Orientation.X) * cameraShake, -- Camera shake while moving
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this camera shake work? It looks like you're applying a weighting for how quickly its orientation will match the target's.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's attached to the torso, it's technically hooked to the animation. It doesn't shift as much on the other axis, however - that's the camera shake modifier.

lib/common/camera/3rd-Person.lua Outdated Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Outdated Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Show resolved Hide resolved
lib/common/camera/3rd-Person.lua Show resolved Hide resolved
Copy link

@ckdavid ckdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments are looking much better. I think it's worth waiting until Hugh's back to confirm that he wants this merged in. I think it's perfectly acceptable for us to make available a bunch of example scripts that provide different functionality, even if they aren't perfect. I just don't think it's going to be the magnum opus that was originally planned, and I wouldn't want to mandate that anyone use them, when there are good-looking alternatives out there e.g. NevermoreEngine, which looks like the robase that was planned.

blurDistance = 0
end

-- Create and play this tween
tweenService:Create(blur, tweenInfo, {Size = blurDistance}):Play()

-- Grabs the speed of the target, and dictates goalFoV depending on ceiling and floor as configured
-- The FoV of the camera will increase depending on the speed of the target, within the bounds of the ceil and floor FoV
local targetSpeed = target.Velocity.magnitude
local goalFoV = math.max(math.min(targetSpeed, ceilFoV), floorFoV)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a math.clamp for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants