You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I land after a jump, the entity walks back a little bit. This does not seem to be influenced by the input of TnuaBuiltinWalk, just some added Velocity that does not impact the rotation like desired_forward. This feels like a slight knockback.
For a full jump of height 4. when walking along -X, I get Vec3(1.0364642, 0., 0.) velocity upon landing.
It even happens when jumping on a dynamic cube. Sometimes it moves the cube normally on contact, sometimes the cube has no added velocity and the control entity moves back on it like on a static surface.
fninput(kb:Res<ButtonInput<KeyCode>>,mutcontrol:Query<&mutTnuaController>,mutlast_dir:Local<Vec3>,){ifletOk(mut control) = control.get_single_mut(){let a = |pos, neg| {0. + if kb.pressed(pos){1.}else{0.} + if kb.pressed(neg){ -1.}else{0.}};let dir = Vec3::new(a(KeyD,KeyA),0.,a(KeyS,KeyW));if dir != Vec3::ZERO{*last_dir = dir;}
control.basis(TnuaBuiltinWalk{desired_velocity: dir.normalize_or_zero()*10.,desired_forward:Some(Dir3::new(dir).unwrap_or(Dir3::new(*last_dir).unwrap_or(Dir3::Z)),),float_height:1.5,coyote_time:0.05,
..default()});if kb.pressed(Space){
control.action(TnuaBuiltinJump{height:4.,
..default()});}}}
While I ended up only debugging the x axis, it works the same on z and any combination of the two, it just walks back.
I at first thought it was the velocity intended to move dynamic bodies on landing, also applied to static bodies, ending up applying the inverse velocity to the control entity, but it sometimes does not move them.
The text was updated successfully, but these errors were encountered:
When I change your example to have a higher float_height, the problem disappear. That's because the character does not touch the ground.
When I change your example to have a slightly higher float_height (e.g. - 1.6 instead of 1.5) - the problem still happens - but less often, and with smaller magnitude. That's because the character doesn't always hit the ground when it falls - but sometimes it does.
When I add Friction::ZERO.with_combine_rule(CoefficientCombine::Min) to the character (and keep using your original float_height - the problem disappear.
I'll try to keep looking into why it happens, but for now either use a large enough float_height for the character to actually float (which, BTW, is the intended way to use Tnua) or set a zero friction (which is also useful against other problems, like #75)
When I land after a jump, the entity walks back a little bit. This does not seem to be influenced by the input of
TnuaBuiltinWalk
, just some addedVelocity
that does not impact the rotation likedesired_forward
. This feels like a slight knockback.For a full jump of height
4.
when walking along-X
, I getVec3(1.0364642, 0., 0.)
velocity upon landing.It even happens when jumping on a dynamic cube. Sometimes it moves the cube normally on contact, sometimes the cube has no added velocity and the control entity moves back on it like on a static surface.
The aforementioned entities :
Here's how I checked velocities :
Lastly, here's where I feed walk and jump :
While I ended up only debugging the x axis, it works the same on z and any combination of the two, it just walks back.
I at first thought it was the velocity intended to move dynamic bodies on landing, also applied to static bodies, ending up applying the inverse velocity to the control entity, but it sometimes does not move them.
The text was updated successfully, but these errors were encountered: