Hello. Why is she walking like that? I cant figure out how to turn her 90
Thank you.
It’d be more suitable to create a new character class blueprint for your NPC’s instead of an actor class one.
Once you do that, you can move them by using the Add Movement Input
or the move to nodes (such as Simple Move to Location
, Move to Location
, AI Move To
, etc.) instead of constantly teleporting them.
And you can make them face the direction of the movement by clicking on the movement component on the Components window that should be located on the top left, then navigate to the Details window on the top right while having it selected, search for “orient rotation to movement” and enable the setting.
Hope this helps!
Hi. I’m encountering some issues. Firstly, I have other static meshes that also need to move along the spline,but they also move sideway and I’m unsure if the Character Blueprint is suitable for them. I was hoping for a solution that would work for any asset I want to move in the background.
I’m treating the woman as an asset, not an AI character. I’m only four months into Unreal Engine, so I’m still learning the intricacies of nodes and Blueprints.
I’ve tried your solution with the woman mesh, but it’s not working as expected. I will continue to investigate and troubleshoot the issue.
We don’t have much context of what you’re mentioning here, but if they’re gonna be like chess pieces for example, it’d be more suitable to have pawn class blueprints for them (you were using the actor class in the image you provided, so I assume those you mentioned are also actor class)
You can still make actor or pawn class “characters” face to the direction of the movement by getting the velocity with the Get Velocity
node, normalizing it with the Normalize
node, and use the vector type result to get the target world rotation like this:
This is an old image I uploaded for another topic, that’s the reason for the note there saying the calculation should be made with a unit vector. Still nice to have it there though
So just plug our result from the normalization into the Start
pin of the Find Look at Rotation
node. But do not adjust any of the numbers you see there.
With this float type value, you can set your actor’s world rotation’s z component. You can expose the z component by right clicking on the purplish-grey New Rotation
pin of the Set Actor Rotation
node, and selecting the Split Struct Pin
option on the menu that pops up.
The approach I provided above (in this post, not in my initial post) also works with character class blueprints, so you can implement it to any actors. However the better way (for NPC’s, not for visuals in the background) which I explained in my initial post can’t be done with actor or pawn class “characters”, because it requires the character movement component. You can still give it a shot though because you’d be able to achieve better results that way, considering your objective.
Added later:
Hmm in fact, I think you want these to only be visuals out of bounds, so their path won’t change depending on certain conditions. In that case, you can as well consider creating (or editing the existing) animations that are not in place and placing them into the scene. You also mentioned spline though maybe they’re gonna be aligned with the terrain. So if they’re not gonna be actual NPC’s that can be interacted with or have behaviors, you wouldn’t need them to be character class.
Also added a clarification in parentheses where I suggested the use of character class. Again, you’d use them for NPC’s, but if these are gonna be purely visuals, actor or pawn classes should suffice.
After trying out my approach in this post, if you want to try out the more appropriate way (for NPC’s, not for visuals in the background) as well, you can share screenshots of your character blueprint’s Event Graph (showcasing how you implemented the movement), and the Orient Rotation to Movement setting of the movement component (which you can access by clicking on the movement component from the Components window, and then navigating to the Details window while having it selected)
Hope this helps!