Skip to content
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

Vehicle Wheel doesnt spin on air #37018

Open
Tracked by #45333
abFrancisco opened this issue Mar 13, 2020 · 8 comments
Open
Tracked by #45333

Vehicle Wheel doesnt spin on air #37018

abFrancisco opened this issue Mar 13, 2020 · 8 comments

Comments

@abFrancisco
Copy link

abFrancisco commented Mar 13, 2020

Windows 10
Ryzen 5 2600, Nvidia GTX 1060
Godot 3.2

If applying an engineforce to the wheel, they only spin when in contact with something.
I applied a engine force to a single wheel and also to the vehicle body and while on the air the wheel mesh doesnt appear to be spinning and wheel.get_rpm() returns 0
Also when on the ground and skidding(i set friction slip to 0.1) the wheel doesnt keep rotating if you accelerate, it matches the speed of the road, for example, if the car is rolling backwards and you accelerate forwards the wheels keep rotating backwards

@pouleyKetchoupp
Copy link
Contributor

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

@anselme16
Copy link

It is still the case in 3.3.2 stable

Even though it looks like a bug, it also looks like it's an intended behaviour.

@Codezilluh
Copy link

Yes, this is rather unfortunate. Maybe it would not be hard to add? I don't know, I am new to Godot. The code here is just a concept for logic.

If the sign of the direction does not match the sign of the engine force, then the wheels should move in the opposite direction:

if sign(_vehicle_direction) !== sign(engine_force):
    wheel_spin_dir = -wheel_spin_dir

There should also be a way to override the wheel spin, so users can do something like:

if _vehicle_moving and !is_in_contact():
    # something to manually spin the wheels here

@ash-hashtag
Copy link

This is intended from the docs
https://docs.godotengine.org/en/stable/classes/class_vehiclewheel.html#class-vehiclewheel-property-engine-force

But don't know why they chose it to be. Wheels should spin in the air too, like ramping up.

@Zireael07
Copy link
Contributor

@ash-hashtag: The VehicleBody and VehicleWheel are ports of Bullet's functionality. I am not sure whether the original authors intended this or not...

@Calinou
Copy link
Member

Calinou commented Jul 25, 2022

Please upload a minimal reproduction project to make this easier to troubleshoot.

@crunchpaste
Copy link

I can confirm the same issue appears in Godot 4.

A minimal reproduction project

The same thing happens when the wheel is skidding, but I guess that should be a different bug report?

@Scorpy-37
Copy link

I'm highly sure this is because the RPM is more a value that returns the contact RPM. When the wheels aren't in contact with anything they aren't pushing the car forward therefore meaning the RPM is 0. The wheel rotation probably uses the RPM value to spin the wheels so that's why they don't spin while in the air or spin faster when the wheels are spinning out. You may need to spin the wheels manually if they're not in contact with the ground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants