#parts moving player but not other objects for some reason

1 messages · Page 1 of 1 (latest)

upper flame
#

so im trying to make a fps viewmodel so ive cloned the character and have them follow the camera (currently moved a bit out so i can see it to make sure im setting everything correctly)
ive run into a problem tho which is it can touch and move the player (bad) but for some reason doesnt touch or move other things like rigs (good but i need it to not touch or move player too)
ive gone through every part and mesh part in the cloned character and set every variable i found that i thought could be messing with this (shown in the code below) but none of them stopped this from happening. how fix?

for i in children do
    local part = children[i]
    if part:IsA("MeshPart") or part:IsA("Part") then
        part.CastShadow = false
        part.EnableFluidForces = false
        part.CanCollide = false
        part.CanTouch = false
        part.CanQuery = false
        part.Massless = true
    end
end
view_model.Head.Anchored = true```
ornate thorn
#

What

upper flame
#

the floating body is attached to the camera so it moves around with me and i need it to not collide with anything cuz when it does the player kinda flies around uncontrollably when zoomed in but setting can collide to false on all of its parts didnt fix that (still collides with the player altho its not colliding with anythign else) and idk what to do

ornate thorn
#

local PhysicsService = game:GetService("PhysicsService")
local groupName = "ViewModel"

pcall(function() PhysicsService:CreateCollisionGroup(groupName) end)

PhysicsService:CollisionGroupSetCollidable(groupName, groupName, false)
PhysicsService:CollisionGroupSetCollidable(groupName, "Default", false)

for _, part in ipairs(view_model:GetDescendants()) do
if part:IsA("MeshPart") or part:IsA("Part") then
part.CastShadow = false
part.EnableFluidForces = false
part.CanCollide = false
part.CanTouch = false
part.CanQuery = false
part.Massless = true
part.CollisionGroup = groupName
end
end

view_model.Head.Anchored = true

#

Try using this instead

upper flame
#

thank u so much that worked 😭🙌