Attaching Camera to a Part?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I have cutscene attacks for my game. The camera-part is animated for the cutscene. I’d like to get the camera to follow the camera-part that was animated.

  2. What is the issue? I can’t seem to get the camera to stay on the part. It stays at one point for the duration.

  3. What solutions have you tried so far? I’ve tried making the cameratype scriptable, and making the camera cframe be that of the camera part. Nothing has worked.

1 Like

You will get more help if you show your code, so we can see where you are, in your progress of coding and can offer solutions or even a better way of doing it.

When posting your script , be sure to use the ``` symbol before and after your code

Such as…

image

print("Hello World")

As for your issue. A few things.
You have your camera set to Track, but maybe it needs to be Scriptable.
Also, is the animation playing on a part that is using a mesh with bones, or is it motor6d’s ?
Also, if you want the camera to move with a part, move the camera with a CFrame:PivotTo(), and do that in a loop, such as a render step, so it stays with the part each frame.

2 Likes

game:GetService(“RunService”).RenderStepped:Connect(function())
game.workspace.CurrentCamera.CFrame = animcampart.CFrame
end)

Every frame the camera cframe is set to the animation part cframe
you can disconnect the loop after the animation is done

3 Likes

It’s a mesh with bones. My friend made it in blender.

Mesh with bones, does not register as a moving part.
You will have to use the CFrame of the actual bone that is being moved.

1 Like

It’s a part with a bone in it. Does the same thing still apply?

When animating the part, if you are moving the bone to make the part animate, then yes, you need to have the camera follow the bone’s position.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.