How would I make a viewport frame for a player when they are actually in the game?
Not asking for a script, legitimately asking how I would do it.
Requirements for ViewportFrame
- Needs to have a
Camera
instance as it’sCurrentCamera
. - Items are in the
ViewportFrame
instance.
That’s it. Make sure you set the Camera CFrame correctly to view stuff right
Yeah thats what Im stuck on, I can’t drag the player inside of where I have the viewport frame because then the player wouldnt even be visible in workspace
If you’re trying to parent the player’s character to a ViewportFrame
, well, you can’t.
Then how would I go about making the player show up in the viewport frame?
Have you tried cloning the character then putting that clone into the frame…
The player wont be moving at all…
You have to manually reposition all the parts to match the character every single frame. I know it sounds complicated, but ViewportFrames are primitive.
How would I go about doing that???
You need a script. That’s how scripts work. They do stuff.
You would set a position for the Torso or HumanoidRootPart or something, and then position all the cloned parts relative to it using the same offsets the real parts are.
It sounds complicated, it’s basically like this:
For each real part of the player, you calculate rootPart.CFrame:ToObjectSpace(part.CFrame)
where rootPart is your root part (torso or otherwise).
Then for each clone, you go clone.CFrame = rootPartClone.CFrame * offset
, where clone
is the clone of that real part, rootPartClone
is the clone of your root part, and offset
is what you calculated previously (the toObjectSpace thing)
It seems as though you probably need a dummy model, then for each individual player you clone it and assign it to their VP, you can probably load the players humanoid description onto the model, then constantly update its position to the characters position. Also you’ll need to update the models animations with the players animations. That’s what I got from the little research I did.
Well, yes, you can in studio.
But be aware that a character, even though in the player’s possession, does have some server-sided ties.
If you want to make a character move in a viewport frame, you have to do two things:
- Use
WorldModel
to simulate workspace - Program your own movement system that applies to you character copy.
However making your character move in the frame requires a whole new system, which we won’t provide for you. Hope I helped, but this is as far as we can get.
@MightTea Has mentioned this before, and it’s no different from me.