![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | DoubleCakes |
![]() |
Old Version | Published before Godot 3 was released. |
Once upon a time my PlayerChar node only had one collision box that interacted with enemy attacks and walls. The PlayerChar could walk right through enemies though. Instead of making the enemies hurt the player or making it so the PlayerChar couldn’t walk through the normal collision boxes, I’d rather the PlayerChar and enemies to have a slightly smaller collision box that they couldn’t walk through:
I unsuccessfully tried pulling this off by attaching a KinematicCharacter2D node with a CollisionPolygon2D to both enemies and the player and giving the new Kinematics their own Layer and Mask, but that didn’t work. Here’s how the PlayerChar scene looks like:
Before a move forward, I wish for advice on how to approach this.
I’m not sure to understand the objective of the second collider.
You want player and enemies collide each other and both collide the level or player “transparent” to enemies?
ps: That secondary body won’t be affected by move
(in the sense of triggering it’s physics collisions) and will work as a regular kinematic body, useful for pushing rigidbodies but not for kinematic collisions.
eons | 2016-12-02 00:05
I’m not sure to understand the objective of the second collider.
It’s just supposed to block the player, just like a wall. Difference is that the player and enemies use that second collider so they can get up a little closer to each other compared to regular walls.
DoubleCakes | 2016-12-14 21:37