Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | swordofbling |
After going through my code I found that this bit of code causes the Area2D to not detect any collision.
get_node("P2goal/P2 goal/CollisionShape2D").shape.extents.y = 54
I have also turned on visible Collision Shapes in the Debug and the shape does change correctly, does the extents property cause the CollisionShape not to register collisions as I don’t get why this is causing the problem as when commented out it detects collisions normally.
This seems like a bug. I created a minimal reproduction project, but your line of code works fine for me (at least under Linux). What platform are you using? Does my minimal reproduction project work for you?
Jayman2000 | 2021-03-18 17:54
I tried your project and it seems to work, so I’ve changed it to kind of match what was going on in my game and I’ve recreated the issue it might be something to do with the process(delta) function but I’m not sure, project with the issue
swordofbling | 2021-03-18 18:18
I’ve figured out the cause of the issue if it is continuously trying to set the extents due to the _process(delta)
function, the collision does not register as soon as it stops trying to change it is starts to work again. Not sure how to fix it though.
swordofbling | 2021-03-18 18:49