Script not printing in console

I don’t understand why the "Debug.Log(…) " doesn’t work in this script. On the other scripts no problem but this one doesn’t work.
I checked and the script was successfully added to the player.
Where can I look to find the error?

Thanks so much for the help

Maybe you’re just a pro gamer and not bumping into things :grin:

Check the following:

  • This script should be on the same game object as a collider.
  • The collider must not be marked as a trigger.
  • The game object (or a parent of it) must have a rigidbody attached to it.

Cattura1

I’m a beginner and I’m probably making trivial mistakes but I can’t find this also because the other scripts I made following the course work without problems.

I checked and :

  • This script is on the same game object as a collider.

  • The collider is not marked as a trigger. (screenshots)

  • The game object has a rigid body attached to it.

Is the script on this object? I’m assuming it is (because you checked) I just don’t see it in the screenshot

Can you show the object in the hierarchy and the full inspector? I just want to check a few things. I don’t see anything wrong with the code

Cattura2

Cattura3

Cattura5

Yeah, so that’s the problem. Scorer must be on the same game object as the collider. It’s not

image
The Scorer script is here, but there is no collider on this game object

image
This is the game object with the collider. The Scorer script should be on this object

Thank you very much. You are right. Now all is working.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms