#Area2D not working on current project

23 messages · Page 1 of 1 (latest)

fathom trout
#

I've isolated it so there's nothing else in the way, it won't work. Player is a character, both player and area2d have collisionShape2D, I added the _on_body_entered signal in the area2D and print "WOW" in it, their on the same layer and mask, and when I made a new Godot project it works. What am I missing to make it work on the OG project?

Please and thank you

mellow solstice
#

I can only guess, but it would help if you could share some screenshot of the relevant parts of the OG project where it doesn't work:

  • Collision masks and layers of player and area2d ( but you said that is correct). The mask of the area should be the same as the layer of the player.
  • check if the signal is correctly connected either:
    • via editor: there should be a signal icon next to the node in the scenetree that emits the signal and a green arrow symbol next to the method in the script that prints "WOW"
    • via code with body_entered.connect(_on_body_entered)
  • make sure the areas/collision shapes are actually large enough and they touch each other in the test and you play the correct scene
fathom trout
mellow solstice
#

honestly nothing looks wrong so far 🤔 how does the player scene look like?
if you want you can upload the small og project and i see if it works on my end or what is wrong

fathom trout
#

I hope I did it right. Thank you for helping me with this!

mellow solstice
# fathom trout

Sorry, I cant import the project. every .tscn has .remap added and instead of project.godot it is project.binary
You only have to zip the project folder you work in and nothing else. Did you export the project or similar?

fathom trout
#

I'm lost, can you please lead me so I can make it project.godot?

mellow solstice
#

You only need to go to the folder where your project is in and then zip the folder.
I made some screenshots for example. I have a project called "powernetwork" here.

  • rightclick inside the godot editor and click "open in file manager", then it opens the folder in your explorer (im on windows 11 idk how it is on mac or linux)
  • the folder already has a project.godot file, you dont have to do anything
  • then i rightclick and compress the folder to a zip file... depending on your OS it might be different. In older windows it could be "send to -> compressed"
fathom trout
#

Thank you for the clarification, I thought I needed to export it

mellow solstice
fathom trout
mellow solstice
#

perfect, thanks!

fathom trout
#

thank you!

mellow solstice
#

found the issues

#

You scale your collisionshapes and parents that contain them.
You can technically scale them if the x and y scale is exactly the same, but usually scaling them (especially non uniform) will make the physics engine not calculate stuff properly.

fathom trout
#

oooohhhh

mellow solstice
#

rather change the radius

fathom trout
#

thank you so much! I've spent hours on this and finally gave up

#

I hope you have a great day or night

mellow solstice
#

No problem! Glad i could help^^
And thanks you too!