Game crashes when clicking in inventory menu

Godot Version

v4.2.stable.official [46dc27791]

Question

I am new to Godot and GDscript.
I’m having issues, because the game crashes every time I click with the inventory open. I get error: Invalid get index ‘is’ (on base: ‘InputEventMouseButton’).

What it is supposed to do, is drop an item if there is one selected much like how minecraft works. I followed a YT tutorial from 8 months ago and he doesn’t get the error that I get. Could the code just be outdated? Just unsure on what this error means :confused: :thinking: :sob:

Screenshot of the code in question: Screenshot by Lightshot

The tutorial i was using: https://youtu.be/V79YabQZC1s?si=pqFoH0DEMeUDoCzt&t=3348

Looks to just be a small typo.

event.is.pressed()

should be

event.is_pressed()

You can see the documentation for this method here

2 Likes

You’re the best, thanks

1 Like

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