How to make the player in a 1st person POV to open/close eyes?

Hi, I’m a recently new Godot user using version 4.4.1, and made this account so I could get help.

I’m trying to do some opening and closing of the eyes depending on how long the player holds their left click for. How would that work? I’m trying to make a game in a 1st person POV, and I have no idea what I’m doing.

Currently, I just have two black rectangles to act as the eyelids covering the view.

Sorry if this doesn’t make sense. I wasn’t sure how to word this right.

using two rectangles to cover the screen looks like a fine idea, another option would be to use shaders.
You just have to check for how long the left-click is being hold and then move the rectangles closer to the center

The problem is that I don’t know how. I have no experience coding with GDScript and I don’t know how to look for what I need.

I’d suggest checking on YT for GDScript coding. There are a multitude of videos on the subject. If one creator doesn’t work for you, it happens, watch a different one.

This is like riding a bike. You probably won’t get it the first time. Read on it. Practice. You’ll get the hang of it.

To check if a action is pressed you can call

if Input.is_action_pressed("your_action_name"):
    # move rectangles closer to center
else:
    # move rectangles away from screen

1 Like

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