Open UrbanIndigo opened 2 years ago
Actually, in unitsHaveModels
and walkerSystem
, we are checking if there exists a Unit/Walker without a model.
for (const [id, walker] of world.query(Walker).without(ComponentModel)) {
...
}
Here we could assign the collision group to each base part. You can actually see I've already done that for Walkers.
walkerModel.GetDescendants().forEach((desc) => {
if (desc.IsA("BasePart")) {
PhysicsService.SetPartCollisionGroup(desc, "Walkers");
}
});
@xxOctavianxx Check how the code gets converted from Typescript into Roblox Studio. In ServerScriptService, you'll see there's only one
Script
and the rest areModuleScripts
. In the filesystem, that's calledmain.server.ts
.Your next challenge is to prevent collision between units/enemies and players. So we need to create a new collision group using PhysicsService.
Then we need to create a new
system
in server/systems that assigns this collision group to new players and enemies.I suggest you use
queryChanged
on a model, then check if that entity has aWalker
orUnit
component and change collision group accordingly.Do the same for the player.
I believe this will be quite difficult for you so let me know if you need help