Log in to vote

Problems maybe with PhysicsService?

Asked by 3 days ago

Hello, i am trying to make that specific zombies would be able to walk through specific walls but i always get this error "Unable to cast value to Object". And one more thing how can i get zombies walk through walls if i added more of them in the folder.

local PhysicsService = game:GetService("PhysicsService")

local Colide = "Colide"
local Zombie = "Zombie"

-- Create two collision groups
-- Add an object to each group
local folder = workspace.Spawn

    PhysicsService:SetPartCollisionGroup(script.Parent, Colide)
PhysicsService:SetPartCollisionGroup(workspace.Spawn:GetDescendants("ClimberZombie") , Zombie)
PhysicsService:CollisionGroupSetCollidable(Zombie, Colide, false)

I hope you can help me, bye.

Answer this question