Hello everyone !
I’m doing a 2D top/down movement game.
I made a large background for level, and I’m struggling with collisions.
I made a picture of my project to help you understand.
1 is my player character. It has a circle collider (3) to trigger enemies aggro as it enter enemies trigger zone. (kinematic rigidbody attached)
2 is my player hitbox for making enemies attacking player. It is attached on a child object “attack hitbox”. (kinematic rigidbody attached)
4 is my collision hit box, supposed to prevent player “walking on walls”.It is attached on a child object “collision hitbox”. (dynamic rigidbody attached)
The large red area is my collision area, player must not go past this area. (static rigidbody attached, i tried with dynamic and freeze constraints, my player is moving background when colliding…)
And when I move player… he goes through, but my collider stay stuck outside area, it does not follow player and prevents him to get past area.
Do I have to manage collision with script or collision system is enough ? My main problem is that my collisionhitbox does not follow player and bloack him at entrance of area.
Thanks who anyone who can help me.