Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problems maybe with PhysicsService?

Asked by 3 years 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
PhysicsService:CreateCollisionGroup(Colide)
PhysicsService:CreateCollisionGroup(Zombie)
-- 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