#cargame #avian3d #rustlang
So what I'm trying to do here is to get the velocity at the different positions of the tires.
" rb.velocity_at_point(tire.translation); "
To do that you need to query for a rigidbody to read from, but only
" RigidBodyQueryItem " implements that funcion, all others just have
" rb.linear_velocity " (yes I do now see that I could theoretically calculate that function myself). But the other ways to fetch this rigidbody (in the update schedule) still throw this error \:
#bevy #avian3d #rustlang #cargame
Trying to query an avian3d rigidbody so I can find out the speed at the car tires' positions.
But turns out this line
```
rb : RigidBodyQueryItem
```
Inside the parameter of a function running on "update" Throws a very unhelpfull error message
"
error[E0277]: `fn(Res<'a, Time>, Query<'b, 'c, &mut Transform, With<Player>>, ..., ..., ..., ..., ...) {bil}` does not describe a valid system configuration
--> src/main.rs:9:26
.add_systems(Update, bil)
...
"
#bevy #avian3d #rustlang
Apperently there is like no actual documentation on how to add a force at runtime with avian3d. They just spawn the rigidbody with a ExternalForce::default() component.
In some obscure blog post they did just this, but fetched this force component with
" mut force : Query <&mut ExternalForce> "
Then they just add forces like normal with that force variable.
Thought that you needed to create a force with ExternalForce::default() and then apply it somehow. Silly me :P