Viewport GUI [ASKING]

Is there a way to make viewport character holding a gun and when we select a button in a gui, it change the gun in the viewmodel character? Like in usual game like Call of Duty , etc? Like picture below. Or as a starter how to make viewport that replicate character (but no need to be live, i mean like if we move the viewport character also move) ? but holding gun?

image

1 Like

I’m pretty sure you can have a character in a ViewportFrame with a camera at the desired angle. I believe you’re able to play animations on a character within a ViewportFrame.

Yup, but I don’t want live viewport that shows my character holding weapon because i hold weapon, but what I want is just my character humanoid description maybe replicate to a dummy and this dummy is holding weapon, but when i click a button in a gui, it change the weapon.

sure, grab the humanoid description of the player, create a dummy in workspace.CurrentCamera and apply that description to it, that will client-render your copy. In inventory just move the players’ camera to a place they’re looking at that copy. Play an animation on it with the pose you want but set its speed to 0 to freeze it, if that’s the effect you’re after. You can reference attachment positions on a character, so if the player chooses a different weapon, you can just clone its instance and position it accordingly. Then you don’t need it to be an actual tool or accessory.

Alternatively, you can use viewportframes, but with performance considerations in mind and visual clarity I’d simulate a dummy in workspace, so they have lighting and all that.

well do i need to make animation? Because i just want to make like script weld maybe? Like AtEase, salute tool that you can found on toolbox?

Creating an animation with a single keyframe would be a lot easier, but you could also manually define CFrames of the players’ limbs, being careful not to break their joints else their humanoid fails (shirt/pants will disappear)

I’m unfamiliar with anything of the toolbox but I would imagine they’re running animations like this

There are two ways of doing this:-

1.First Way:-

i)Place All The Guns In the way they should be seen to the player on a dummy.
ii)Then Set All Guns To Transparency=1,execpt the gun on the top of your list.
iii)Add A Script mentioning

When player touches the gun on the gui for example if player touches gun1 tthen
local.Workspace.Gun1.properties.transperency=0
While Transparency of other guns is set to 1 that is they aren invisible.
(This Is Not A Script)

{Note:- All the Guns Will be Palced On The Same Dummy}

This will be valid for each gun on your list.

How will this work:

->Player touches gun1(m4) then gun1 is visible and other guns are invisible.

->Then player touches gun2 (m13) then gun2 is visible and other guns invisible including gun1.

Second way in my second comment

1 Like

Ah this could work but may I ask? So if i want to make all parts inside gun model transparent i just use for loops right?

1 Like

Second Way

Place Dummies ,block parts According to the number of guns in your list and give them each gun.

If there are 13 guns then place 13 Dummies,13 block parts.

Follow the steps now.

1.Position All The Block Parts In Such A Way That its Front Faces The Dummy with a gun.
2.Script the block parts and make them the camera.
3.Script The GUI Such That When The Player Touches Gun 1 The Player will Be Able To See Dummy1 With Gun1 through the block part1 acting as a camera And If Player Touches Gun2
Then The Camera Will switch To block part2 acting as a camera to show Dummy 2 with gun2 and so on…

Hope my both the comments help you in your project

1 Like

Yes you could but was saying that you could just model them into each other on the dummy.
But I guess both the looping and modelling would work