0 votes

I'm making an inventory/menu screen and want to scale down the UI so it doesn't take up as much screen space and to look better. But now of course when I move items around with my cursor. They move at a slower speed than the cursor.

I know why this happens but I don't know how to counteract it. When you scale down, you scale down the mouse pos Vector2 as well which causes the iteminhand to move at a lower speed than the cursor. Here's the code that handles the item movement:

func _input(event : InputEvent):
            if event is InputEventMouseMotion and item_in_hand:
                item_in_hand.rect_position = event.position - item_offset 

I scaled the UI down to 0.66 so I tried to add a " * 1.33 " after item_offset to compensate but it doesn't work(I can't notice a difference). I've had this similar scaling issue for other stuff too but I can't figure out a solution. Any help is appreciated!

Godot version 3.5.1
in Engine by (23 points)

Please log in or register to answer this question.

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.