Character Not Updating Position at End of Animation Montage

I’m trying to update my character’s position at the end of an animation montage using a socket location, but it’s not working as expected. Here’s my setup:

  1. Animation Blueprint:
  • AnimNotify_UpdatePosition at the end of the montage
  1. Character Blueprint:
  • Custom event triggered by AnimNotify_UpdatePosition
  • Get Socket Location (Socket: “CameraSocket”)
  • Transform Location (from Component to World Space)
  • Set Actor Location with the transformed location

Issues:

  • Character doesn’t move to the new position(sometimes at the end of the montage, if the character collides with a collision it resets the character forward into the x-axis or backward into the x-axis and few times it land the character on the expected location )
  • Print String shows new location values, but no visible change
  • Tried enabling Sweep and Teleport in Set Actor Location

Troubleshooting steps:

  • Verified “CameraSocket” exists on the skeleton
  • Checked for root motion in the animation
  • Printed current location, socket location (raw and transformed), and final location

Questions:

  1. What could prevent the character from moving despite correct location values?
  2. Are there any common pitfalls with updating character position this way?
  3. How can I further debug this issue?

Any insights or suggestions would be greatly appreciated. Thanks!

1 Like

If this was in multiplayer I would say that the server is correcting you back.

Other than that, are you sure the AnimNotify is hit. I’ve heard that if it is too close to the end of the animation it can be “blended out” but I’ve never experienced it. (might not be true)

To exclude any errors in the location calculation:
Can you try just hardcoding the New Location in Set Actor Location to something silly like (0,0,500)? Does it teleport you there reliably? It should. (teleport somewhere in the air so you can retest)

1 Like

okay let me try the hardcoding for the new location first
and am planning on setting up for multiplayer but for this early build its offline

yes hardcoding it works so that means the issue is from my get socket location ??

Yea so we know the AnimEvent is hit and the AnimBP is comunicating correctly.

Apparently the taking of the location is breaking. The socket should not disappear suddenly so check the math around it (if any).


am thinking of using a different another blueprint actor location

i connected the GetSocketLocation Return Value to drawDebugSphere
and during the running the sphere was updating but the moment the AnimMontage starts playing it stops

How do you start the whole thing? How do you play that montage? I think just calling play on a montage disables the animation blueprint state machine for the duration. Now why do you loose the socket then - no idea.

Edit:
Also, can you not call Get Owning Actor… On Event Blueprint Initialize Animation you should already have your character and movement components casted to the correct class and stored in BP variables. (That is if you started with any of the starter project animation blueprints)

Actually, you know what - just call some function on your character directly from the AnimNotify and move all the logic for the displacement there. (you will have to do it at some point anyway in order for the networking to work)

1 Like


so i created an actor and linked the root bone to the actor by copying it transformation
then when I used it on the animation blueprint it kinda worked I added the video
and I also took my notifier away from the animation end

“Just call some function on your character directly from the AnimNotify and move all the logic for the displacement there.”

Does that mean I have to do the UpdatePlayer location on the characterBP ??

I am still new to blueprint

and I started the project from scratch no starter content

have successfully moved the function to the BPcharacter
but still got the issue

  1. The character was restored to its previous location before the AnimMontage started
  2. after moving my Notifier to the center of the montage animationBP, I noticed that the location quickly updates to the AnimMontage but later goes back
    CHARACTERBP

CHARACTER ANIMATION BP

update on the situation

It is not a law but is a good practice to keep your character movement in the character. As decoupled the BPs are from one another, the better.
You should probably open and see the animation BP in some of the starting projects. Especially if you are new to blueprints.

That being said this behavior is quite strange for a singlepalyer game.
Can you try it with the command line p.NetShowCorrections turned on just in case?
Also, make sure there is no other place where you set the location of the actor?

where can i get the

p.NetShowCorrections

settings or node and did you check the video I uploaded, I have moved everything to the characterBP except for the trigger event, which happens on the animationBP and then calls the UpdatePlayerPosition function I created in the characterBP

Yes I saw and it is pretty good. I was answering the question in your post weather you have to do it.

Start the game and write in the console (~ key) p.NetShowCorrections 1

1 Like

Ok. I found your problem but I won’t be able to fix it for you. It’s in your animation.

You want to move your character through your animation. (this is called root motion) However, in your the actual animation asset the root bone doesn’t move:

This is why in your game when you make the move your capsule stays in place:
image

After you fix your animation (make the root to move with the character), re-import and enable RootMotion it in the animation asset, it should work.
image

Let me know if it does :wink:

P.S:
The other way to do this is to keep the animation “in place” and move your character procedurally, similar to how the default jump works. However, this move is much more complex and you’ll have to know exactly how you want the character to behave in the air.

Also here is another person with exactly the same problem:

1 Like

The funny thing is my root bone is named hips so I don’t know why its not been registered as root bone in Unreal engine

or does this mean I have to create another bone for my rig and name it RootBone ??

I think am figuring it out now

unreal wants the BoneObject to have the transformation and not the root bone itself
so am transferring the root bone location animation from my root bone to the BoneObject

hey man this isn’t easy have gone through ALOT

so first i created a rig with root bone and transfer all my animation to it (that didn’t work because I created a bone named root and parented the hips bone to it then move all the root motion to it)

secondly i named the bone object to Root and copy all the root motion to the bone object (this kind of works, but with lots of errors)

so, i got really frustrated and exported the unreal engine character with its Rig (then i created a basic animation, and when i check its rig i noticed the parent bone is the hips and the bone object is named Root i open it unreal, and the capsule follows the animation)

so, with that I hurriedly rig my character with unreal engine bone structure (and transferred the animation to it and it works but a new problem was discovered the root motion Z-axis is Ignored, so my capsule does not move it Z-location)

I used Blender with AutoRigPro
Will the capsule follow if I animate my hip bones on the Z-axis?

animation with root motion

animation without toot motion

Yea, I know. I’ve never been good at rigging myself. Unreal wants the character skeleton setup in a particular way.

Yes, however there is code in your character movement component that “glues” your character to the floor while walking/running. Can you change the movement mode to flying and try again.

1 Like