-
What do you want to achieve? I want to create a ViewportFrame but it’ll give me a live image of the character. So if the characters moves, then the viewport would follow the character. I want the camera to be facing the character in the front.
-
What is the issue? I’m not sure how to go about it. First, I tried to put the camera my character and started moving but that didn’t work, it just stood still like an image.
-
What solutions have you tried so far? I’ve tried looking for solutions but I don’t think this topic has been covered before.
shouldnt a while loop be a simple solution to this? you can just have the camera cframe update every frame to a desired position infront of the character
There might be a more elegant solution, but here’s the one that first came to my mind:
I’d set up a function that updates every render step. Each time it ran, it would get the position of every body part of the actual character in Workspace. Just setting the clones position to match that wouldn’t work though. We want the clone to be positioned at or around 0, 0, 0 inside of the viewport frame for ease of use and to make the camera work.
To accomplish this you’d need to be getting the offset of each actual character body part from 0, 0, 0. Either :ToWorldSpace or :ToObjectSpace called on the actual character parts would accomplish this, however you’d have to research which one since I can’t remember at the moment. Then, with the offset CFrame of each body part, you could set the clones body parts based on that, so it’s positioned at 0, 0, 0.
With this method you wouldn’t need to update the viewport camera more than once, as the clone inside of the viewport wouldn’t actually be moving.
Again, there’s probably an easier way to do this, but this method would work in theory.
Hey, I tried doing your solution, would I do “while true do” and then clone the character/player every time they move, or something else?
everytime they move or every step/renderstep is what i’d probably do