Rotating a viewport camera Help!

I want to make it so that the view on my object is rotated to the side and not the bottom pointing at the CFrame but the entire sword of it.

The Sword is
Image2

And the result is
Image

cam.CFrame = CFrame.new(object.Handle.Position + (object.Handle.CFrame.lookVector*5) + Vector3.new(0,0,10), object.Handle.Position)
1 Like

Assuming that the sword is a tool

local camera = ...
local Tool = ...
local SwordModel = tool.SwordModel

local Center = SwordModel:GetPivot()
camera.CFrame = CFrame.new((Center * CFrame.new(0, 0, 5)).Position, swordCenter.Position)

This basically aligns the camera with the center of the sword and moves it outwards away from the sword by 5 studs, then it fixes the rotation of the camera by refocusing the camera on the sword

1 Like

it didn’t work as expected :')

1 Like

What did you end up getting? Also it would be much easier to help if I could see how the sword is setup.

1 Like

isn’t just there a way to rotate the viewport camera at any orientation? or if it is not possible it would do it just to rotate the object

1 Like

Can we see the entire script? Are you creating a new camera?

2 Likes

my best guess is that your handle is facing downwards (or upwards)
you’re moving forward by 5 and then up by 10, but your camera is looking directly down (or up) at your sword with seemingly no movement on the x or z axis.

id try changing the direction of the handle.
if you cant then try rightvector or upvector instead of lookvector

what does this stand for? why not to use “Center” instead?

and how would i do that? sorry