I’m trying to get the ship to cancel any previous momentum when changing movement direction (direction ship is facing).
In the clip you can see that after changing direction, the ship continues moving sideways in the direction of the previous movement for quite a while before headingin the new direction.
I want to cancel all (or if I can be picky 95% of) the momentum it built up in its previous direction when rotating to face a new direction.
End result should be that as the ship rotates to face a new direction it continues drifting sideways for maybe 0.1 before all full speed in the new facing direction.
If you’re using physics, you will need to manually calculate a vector based on your current velocity and new desired direction, and then add it as force to counter the momentum.
The dot product will tell you how well your current velocity is aligned with your desired facing direction. 95% is probably around dot .9997 (eyeballing it)
I’ve played around a bit with floating pawn movement and you’re right, it seems to have the exact movement characteristics I’m looking for. Really appreciate the suggestion!
I am having an issue I can’t figure out and searching hasn’t been much luck:
I can see from the transform that the character is moving (likely) correctly on input, but the character appears to not be moving besides when rotating. The background doesn’t move when moving on the XY axis.
Another quirk is that on start I have a ‘space dust’ BP that gets attached to the player so generate particles while moving. After switching to floating pawn movment it no longer auto attaches (I can likely figure this out) but when I drag it in the outliner during play to attach to the character it doesn’t move with it like it did with ‘character movement’.
do use Enhanced Input, I was too lazy to set it up here
the collider (here Cube), should be at the root of the actor and it should not simulate physics
Turning Boost at 0.1:
Turning Boost at a much snappier 2.0:
‘space dust’ BP that gets attached to the player so generate particles while moving. After switching to floating pawn movment it no longer auto attaches
That should not impact anything, but do consider using a Child Actor Component instead:
Thanks for taking the time to help solve this for me, this is exactly what I was looking for! I had ended up finding a plug-in on the marketplace that worked for me but after building out your example I’m going to go this route instead.
Also, I appreciate the suggestion for the child actor component. I’ve been doing some awkward things that just felt wrong to accomplish the same effect throughout my project so this will help a ton.