#Trouble getting colliders to work (Solved)

5 messages · Page 1 of 1 (latest)

cobalt needle
#

I've been having trouble getting my collisions to collide.
I have them set up on the inspector for the scene objects.
I just tried setting some filters and now I'm getting an error on the line where I set the first filter.
Everything I look at about using colliders seems to be a little different, so as much as I play with it and try to figure it out, I'm still not quite sure what's going on.

Any ideas why it's not recognizing the colliders?

Error:

Stack trace:
<anonymous>@3D Models/FullScript.js:44
<anonymous>@3D Models/FullScript.js:4```

Code:
```//@input SceneObject enemy1
//@input SceneObject enemy2
//@input SceneObject enemy3

var enemies = [
    { obj: script.enemy1, atkTime: 0, hp: 2 },
    { obj: script.enemy2, atkTime: 0, hp: 2 },
    { obj: script.enemy3, atkTime: 0, hp: 2 }
];

//Enemy Collisions
var coll0 = enemies[0].obj.getComponent("Physics.ColliderComponent");

//Here's where I'm getting an error
coll0.filter.includeDynamic = true;
coll0.filter.includeIntangible = false;
coll0.filter.includeStatic = false;```
wind wren
#

maybe you forget to assign physics filter to the collider?

cobalt needle
# wind wren maybe you forget to assign physics filter to the collider?

I didn't have that. Thanks you!!
I'm getting the enemy collision printouts now in the logger, but for some reason they're having random collisions as they walk towards me (they're not near each other, or anything else, so I'm not sure what they're hitting). Any idea what might be causing these random collisions?

#

also, I don't think my projectiles are causing collisions.
They're loaded in as SceneObjects, and have a Physics Body with filter and overlap filter set just in case. I've also tried it with a Physics Collider instead of a Body and wasn't having any luck there either.

cobalt needle
#

^^ I solved those problems, and everything's working almost smoothly lol