-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input.get_vector() does not respect Input.action_press() #62593
Comments
cc @aaronfranke |
Do we want raw strength to contain simulated input? We'd need to do one of these three things:
|
I'm not sure if it's actually a useful suggestion, but what about a set_vector function that's publicly available? Could simulate it that way, and it could do it in such a way that get_vector just works. |
I made this as a quick&dirty hotfix:
Should more or less work until this is fixed. Maybe someone will find this useful... (CC0) |
I would like to add that this bug also makes inputs from |
Godot version
3.5.rc5
System information
Windows 11
Issue description
Working on a tutorial using simulated input, I noticed that if you use Input.action_press() to simulate input, it will not be picked up, no matter what values you use, in Input.get_vector(). The reason appears to be that at some point or another, the raw_strength of the simulated action is set to 0, and that's what get_vector() uses. The action_strength has the correct value, but because it uses the raw_strength, get_vector() returns Vector2(). This might be intentional, but I'm not sure. I have attached a repro project - it's fairly big, didn't bother to create a new one, just the one I'll be using for my tutorial.
I suppose for some reason this might be on purpose, but it seems like in other parts of the codebase, the raw_strength is actually the same as the normal strength, so it's confusing to me why this would differ, especially if I set the strength directly in my Input.action_press() call (it is not set that way currently, but it's easy enough to manipulate).
In the repro project below, it is possible to work around this by manually building the vector, but I don't really see why I shouldn't be able to use Input.get_vector().
Steps to reproduce
Quick edited note:
You can repro the desired behavior by using the arrows or WASD to generate the values I would expect from Input.get_vector().
Minimal reproduction project
UnidentifiedFlyingAwesome.zip
The text was updated successfully, but these errors were encountered: