How to prevent the camera going in when the unit pops up

As you can see in the video below when the unit/character pops up on the camera the camera goes in a bit inwards.

I tried making the DevCameraOcclusionMode to Zoom and still didn’t work

Currently I’am showing the unit this way:

    for _,v in pairs(Item:GetDescendants()) do
        if v:IsA("BasePart") then
            v.CastShadow = false
            v.CanCollide = false
            v.CollisionGroup = "Units"
        end
    end
    
    local Connection
    Connection = RunService.RenderStepped:Connect(function()
        if Item and Item.Parent then
            Item:PivotTo((Camera.CFrame * CF) * CFrame.Angles(rx,ry,rz))
        end
    end)

Any help would be much appreciated :pray:

try running this code before you parent the Item to workspace

1 Like

Im new at scripting but i have an idea: what if you will increase size of unit when they showed on?

I tried it and made it worse :sob:

They won’t work, I want what most TDS games have when opening banner or viewing a unit

They probably use ViewportFrames instead of actually placing the model in front of the camera.

They don’t since it can go through the character and can have VFX played on them

1 Like

The humanoid is automatically setting CanCollide for some of the parts back to true, can the CollisionGroup Units collide with Default? I managed to fix the issue in a test place by setting all parts in the cloned model to a collision group that cant collide with Default before parenting it to workspace.

1 Like

It worked! Been trying to fix this for ages, thanking you so much!

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