Incorrect character position

Initial setup:

Character with simple skeletal mesh and simulated physics. coords: (0, 0, 0).

3 objects with coords:

  1. (2398001.5 cm ; -192263.328125 cm ; 0)
  2. (-1482171.625 cm ; 4708579.5 cm; 0)
  3. (1889347.75 cm ; 8625850.0 cm ; 0)

move character by simple applying vector like MovementVector * DeltaTime or by AddForce or AddImpulse for skeletal mesh.

move from (0, 0, 0) to FIRST object, then to SECOND.

there is a bug:

98343-scr0.png

next frame:

98344-scr1.png

look at the Character position. WTF? it was really shifted to impossible position.

with world origin shifting there is same issue in exact same Character position (with subtraction from world origin location)

there is a THIRD object. you can move from second to third and see same issue. after you can move from third to first and see same issue. but these objects stays in their positions. there is only character moves.

if i change character position manually by the editor - there is no issue, but if i setting location by SetActorLocation or simulate physics movement - bug appears.

trying to fix that for 2 days and nothing, but how if it just 1 code line with one API-function call? urgently need some thoughts or maybe workaround for in-game solution, not for the editor.

Thanks

Hello,

  • Are you using blueprints or C++?
  • Could you provide more detail on your setup? Screenshots or code from your relevant classes would be great.
  • Could you explain exactly what you’re trying to accomplish?
  • What results are you expecting to see, and what results are you actually seeing?

Hi.
I using pure C++.
Standard pawn class with skeletal mesh. Nothing else.

What am i doing? I am moving my character to my own direction, as you can see on screenshots above. I can do it:

// FVector MovementVector, for example (10, 0, 0)
// inside tick function
SetActorLocation(GetActorLocation() + MovementVector * DeltaTime);

// also inside input functions or anywhere else
SkeletalMeshComponent->AddForce(Force, BoneName, bAccelChange);
// or
SkeletalMeshComponent->AddImpulse(Force, BoneName, bVelChange);

thats all what i doing and have incorrect character position while moving like on screenshots above.

as i can calculate expected result:
if we have velocity change per second (-2034948, 2624202, -22203)

if we have position (529088, 2054358, -46758)

movement result might be at least (x < 529088, y > 2054358, z < -46758)

in fact there is (x < (correct, but maybe not), y < (more less, more more less. incorrect), z > (more greater, incorrect)).

while i in-game, i see it like other objects teleporting to another position, but in fact they are not - just my character teleports

SetActorLocation and AddForce/AddImpulse not together. There is either only SetActorLocation without AddForce/AddImpulse or only AddForce/AddImpulse without SetActorLocation

Fixed. Clean my project build and full rebuild engine + project.

Seems like “Have you tried turning it off and on again?”