The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Hi,

I'm new to Godot and have been working on my first platform game.

After designating layers for collision, all my Enemies are detecting Player perfectly when Player is in contact with them, but for some reason at the start of the level, all the enemies detect Player immediately, even though Player is nowhere near any of them.

Is there anything I'm maybe missing or doing wrong?

Thanks guys!

Godot version 3.0
in Engine by (14 points)

we need more information to help you. Maybe some codesnippets and screenshots would be great. The whole project-folder would be even better :)

It's my first project and very experimental, I've been following tutorials for the most part. Forgive me if it looks a little unorganized lol but I appreciate all the help, this is a community I'm looking forward to interacting with.

The link is to my drive, please check it out and let me know what you. For some reason any collisions I add are being detected but are not blocking anything as well.

https://drive.google.com/drive/folders/1mz_pMEDzSZt2wzj_EVxgerUlvmlccLqC?usp=sharing

1 Answer

0 votes

Sorry for the late answer,

if you modify line 41 in goomba.gd to

print("side %s" % body.name)

it will tell you, that it ts colliding with the Tilemap, not with the player.


The probably best solution is to add

class_name Player

in KinematicBody2D.gd : line 2 (your player-script)

and change the function in goombe.gd to

func _on_side_checker_body_entered(body):
    if not body is Player:
        return
    print("side %s" % body.name)

hope the answer is not too late...

by (1,536 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.