Rendering the character with a ViewportFrame

local offset = HumanoidRootPart.CFrame:toObjectSpace(someOtherPart.CFrame)

You’d then use the offset in your ViewportFrame to position everything relative to the HumanoidRootPart.

1 Like

I presume you’re attempting to do something along the lines of this

if so then I’d recommend using "Dual Render" Scope System

1 Like

Not really, more like the character I linked here.

If you give me some time, I’ll modify my camera system to do that for you!

2 Likes

Sure!

1 Like

Update 6/13/2021:
Rewritten for the latest Luau VM, using better coding style and more efficient practices.

Includes an OFFSET variable to control where the view is positioned relative to the HumanoidRootPart.

Enjoy!

Model File: CharacterViewport.rbxm (4.6 KB)

148 Likes

Does this include updates incase the player has armor added on for example?

1 Like

Oh, my bad.

I’ll go add that and update the OP when done!

Thank you so much, I’ll mark it as a solution for you.

Also one small thing, (although I can fix this), the file you sent does not include the ‘CameraPart’ and ‘Screen’ parts of workspace.

Yeah I forgot to remove that :rofl:

It’s a leftover from the Camera system. I’ve fixed it in this new version that I will send shortly.

Updated the post with a new file

2 Likes

Works, thank you so very much. If you need anything from me, just ask me on the DevForum or twitter, or discord. My respect is eternally given to you.

6 Likes

This works perfectly, but I think there’s a memory leak or something because if I rapidly equip and unequip a tool, my FPS just keeps decimating and decimating. I went from like 80fps to 20 from maybe 10-15 seconds of quick switching

Sounds likely. Something I whipped together quickly a year ago is likely to be subpar.

3 Likes

Wow, you replied fast, I appreciate it!

What can I do to fix it though?

You think I remember what I wrote a year ago? Ha!

I wish you good luck! :smiley:

5 Likes

Welp. Anyways, thanks for responding though

1 Like

This is awesome and so nice of you for making it open source!

Is there a way to stop the current character in the VPF and add a new character later on in a function? If not no worries :slight_smile:

EDIT: I have found a solution, sorry for any inconveniences!

1 Like

Please help me fix this, basically when you equip an item it duplicates your character 8 times and puts it in the view port when you unequip it its 16 and so on.