Issue with Accessories offsetting the CFrame in a ViewportFrame

I was experimenting around in studio after getting inspired by games such as cart ride for corndog making 3D characters into 2D sprites/projections using BillboardGui for their 1995 style and Fallen Aces

It went pretty smooth up until I playtested with my alt account and noticed that it’s offset/lower than my main account’s character
image

I came to the conclusion that it’s the accessories, specifically from the real Character (not the one in the BillboardGui)
removing hat

There are 2 characters in my game, the real one and the fake one in the BillboardGui (which is animated/scripted), deleting the hat from the fake one doesn’t do anything but deleting the hat from the real one offsets it

I checked the pivot position from the real character and it wasn’t changed after removing the hat

The code changes the CFrame of the fake character to match the real character’s rotation (first line)

The viewport’s camera CFrame is set to the current player’s camera rotation with a lookAt that’s offset by 9 studs pointing towards the character, which basically mimicks what the real camera should see with 3D characters (keeping in mind it’s separate Billboards so it’s all local to each Billboard)

billboards

I suspect that it has something to do with :GetPivot() but I don’t know any other alternatives for my case

Code:

FakeCharacter:PivotTo(Character:GetPivot().Rotation)

Camera.CFrame = workspace.CurrentCamera.CFrame.Rotation * CFrame.lookAt(FakeCharacter.PrimaryPart.Position + Vector3.new(0,0,9),FakeCharacter.PrimaryPart.Position)

Figured out a simple solution

  • Made a local folder on the Player if they aren’t LocalPlayer (because there’s no way to reset their CharacterAppearence or apply HumanoidDescription locally)
  • Moved the accessories of other player’s characters to the folder made locally in each player
  • Everytime the function starts it moves the Accessories from the folder to their character before cloning the Character to be used as the Fake Character
  • Made the folder “linked” to the character so if the character is gone the folder does :ClearAllChildren(), resetting the system

There is probably a way better solution but this works for me
image

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