Camera manipulation with plugin development

Thank you for sharing this. It allowed me to make this (with Script Stash)

return {
	Name = 'Focus Viewmodel',
	Description = 'Set up the Camera for the selected (or last selected) Viewmodel.',
	ConfirmRun = false,
	Run = function(ctx)
		local viewmodel = ctx.Selection[1];
		if not viewmodel then
			viewmodel = _G.LastUsedViewmodel;
		end;
		assert(viewmodel and viewmodel:IsA('Model'), 'Selected instance is not a Viewmodel');
		_G.LastUsedViewmodel = viewmodel;

		local camera = workspace.CurrentCamera;

		camera.CameraType = Enum.CameraType.Scriptable;
		camera.CFrame = viewmodel.HumanoidRootPart.CFrame;
		task.wait();
		camera.CameraType = Enum.CameraType.Fixed;
	end,
};
1 Like