#hi i have some problems in a moving system look vid i think those are the collisions maybe

1 messages · Page 1 of 1 (latest)

tiny sage
midnight slate
tiny sage
#

oh yes i forgot ty to remind me

rapid juniper
#

.

#

bro do you need to have live collabs and asset manager open all the time? evilcat

#

why are you doing this so complicated

#

@tiny sage

tiny sage
#

so i can do rounds easily after

rapid juniper
#

???

#

that doesnt make any sense

tiny sage
#

i can just make rounds like that now or add maps easily

tiny sage
rapid juniper
tiny sage
#

oh now i can add new maps whenever i want or enemies

#

i dont have a script per enemy also so i dont use to much memory

rapid juniper
#
game.ServerStorage.bindables.EnemySpawned.Event:Connect(function(enemyModel, map)
    local rootpart = enemyModel:FindFirstChild("HumanoidRootPart")
    local humanoid = enemyModel:FindFirstChild("Humanoid")
    local wayPoints = {}
    local wayPointCount = map:FindFirstChild("Waypoints"):FindFirstChild("ammount").Value
    for i = 1, wayPointCount do
        table.insert(wayPoints, map:FindFirstChild("Waypoints"):FindFirstChild(tostring(i)))
    end
    print(humanoid)
    humanoid:MoveTo(wayPoints[1].Position)
end)
game.ServerStorage.bindables.EnemySpawned.Event:Connect(function(enemyModel, map)
    local rootpart = enemyModel:FindFirstChild("HumanoidRootPart")
    local humanoid = enemyModel:FindFirstChild("Humanoid")
    local waypoints = map:FindFirstChild("Waypoints"):GetChildren()
    
    if not rootpart or humanoid then return end
    
    for _, waypoint in waypoints do
        print(humanoid)
        
        humanoid:MoveTo(waypoint.Position)
        humanoid.MoveToFinished:Wait()
    end
end)
#

Why wouldnt my script work

#

the lower one

tiny sage
#

idk send vid of what is not working or write

strange inlet
#

Try replace _, with i,

#

Okay then dont ask me

#

You're clowning just because I didnt finished my words yet

tiny sage
#

no _ is fine if you dont use the index

rapid juniper
tiny sage
rapid juniper
strange inlet
rapid juniper
#

alr mb

#

wait

#

gimme a sek

#
game.ServerStorage.bindables.EnemySpawned.Event:Connect(function(enemyModel, map)
    local rootpart = enemyModel:FindFirstChild("HumanoidRootPart")
    local humanoid = enemyModel:FindFirstChild("Humanoid")
    local waypoints = map:FindFirstChild("Waypoints"):GetChildren()
    
    if not rootpart or humanoid then return end

    table.sort(waypoints, function(a, b)
        return a.Name < b.Name
    end)
    
    for _, waypoint in waypoints do
        print(humanoid)
        
        humanoid:MoveTo(waypoint.Position)
        humanoid.MoveToFinished:Wait()
    end
end)
tiny sage
#

it is the same with a for loop as sayed i just used go to waypoint 1 bcs im fixing the bug

tiny sage
tiny sage
# rapid juniper https://create.roblox.com/docs/reference/engine/classes/BasePart#CollisionGroup
local physcics = game:GetService("PhysicsService")

physcics:RegisterCollisionGroup("NonPlayerColissionGroup")
physcics:RegisterCollisionGroup("Map")
physcics:RegisterCollisionGroup("Enemy")
physcics:CollisionGroupSetCollidable("Enemy","Default",false)
physcics:CollisionGroupSetCollidable("Enemy","Enemy",false)
function enemie:Spawn(pos, parent)
    print("spawning")
    local enemyClone = self.model:Clone()
    local guiClone = self.gui:Clone()
    enemyClone.HumanoidRootPart.CollisionGroup = 'Enemy'
    enemyClone.Parent = parent
    enemyClone.HumanoidRootPart:SetNetworkOwner(nil)
    enemyClone["HumanoidRootPart"].Position = pos
    guiClone.Parent = enemyClone
    guiClone.Enabled = true
    game.ServerStorage.bindables.EnemySpawned:Fire(enemyClone,parent.Parent)
    return enemyClone
end
rapid juniper
#

ouhhh

#

you already got that

tiny sage
#

yes

#

you tought it was that easy

rapid juniper
#

i still think its easy

tiny sage
#

so

#

i guess i can use tween but i will have problems later if i do that

rapid juniper
#

Mine can collide

tiny sage
#

me to that is what gets wrong every time it kind of glitchy and on the end it is just chaos

rapid juniper
#

you need to set all baseparts to no collide

#

to the collision group

tiny sage
#

there is only the rootpart rn i dont have model yet

rapid juniper
#

hm

#
local PhysicsService = game:GetService("PhysicsService")
local RigsFolder = workspace:WaitForChild("Rigs")

local GROUP_NAME = "RigNoCollide"

PhysicsService:RegisterCollisionGroup(GROUP_NAME)
PhysicsService:CollisionGroupSetCollidable(GROUP_NAME, GROUP_NAME, false)

local function applyCollisionGroup(model: Model)
    for _, part in model:GetDescendants() do
        if part:IsA("BasePart") then
            part.CollisionGroup = GROUP_NAME
        end
    end
end

for _, rig in RigsFolder:GetChildren() do
    if rig:IsA("Model") then
        applyCollisionGroup(rig)
    end
end

Fr im sorry but I dont really use collisiongroups so I cant really tell you what your problem is I can just tell you that this script works perfectly fine for my rigs

tiny sage
#

i'll try with rigs maybe it will work bcs in model there is only one part

rapid juniper
#

you should defo try rigs cause the got health also

tiny sage
#

any humanoid got health it is a proprity

rapid juniper
#

still

#

rig got yall you need

#

yk

tiny sage
#

works now

rapid juniper
#

nicwe