Hi everyone!
I was training in create a blend space between idle state and a custom anim i made for a npc. In its BP, I’ve just created a random event (random roaming) in Event Being Play to check easly if the blend was working. During the simulation, the ai is playing my custom anim but it’s not rotating properly when it’s changing direction. What could be the problem? Thank you yall!
There might be many reasons for this and it’s challenging to guess with limited information. I’m sure you will find why is that eventually but for a quick fix, you can simply rotate it accordingly to the direction of it’s velocity. And if you’re still curious about the root of the problem, you can send the screenshots of your code where you handle the roaming. Are you using the the AI move to node or something else?
In the random roam task, I’m assuming your using get random location in navigable radius? Use " get look at rotation", plug in that random location and your actors location then set actor rotation before executing the move to
That’s the code I’m using rn for this test.
I can’t find “Get look at rotation” @doctorpepperdan
It’s strange because i used this same event on other npcs (default mannequin) and they’re moving/rotating without strange issues. But for this one in particular, for its blend space, I mixed a mesh with a different skeletal. Could be the mismatch between them the problem? Thank you all guys!
Can you try using the “Orient Rotation to Movement” node and set it to true?
Correction “find look at rotation”
I tried but nothing is changed. But I’m not sure they’re linked correctly.
I tought…start rotating (from actor location) to the target (random location).
This is the way you meant?
Can you show me an example of this node mate? Thank you so much!
It may not have shown up if your context sensitivity is on. But you should be able to pull it out of the movement component
Sorry mate! I’m kinda new on visual coding. Did you meant setting it true using a branch?
Were you able to place that node in your blueprint? It should also come with a checkbox within the node itself. And the movement component should be plugged into it’s target pin
i got the node pulling out the “char mov component” but there’s no checkbox. I could set it true by the Default Value in the Details panel of this comp. But in my case, the checkbox is disabled.
Can you send a screenshot? It should be a red node with a text saying “set” on top of it
The node pulled out from char mov comp has no options but in its details panel on right side, I could set it as true but in my case is disabled, Idk why honestly.
Yeah I did guess that and then added that note saying you should get the “set” one
Yeah. Is it working now? If not, you can try my initial suggestion which was rotating the character to the direction of it’s velocity. And while doing that, you can use a finterp node to make that turn smooth.
Ummm… I was checking you screenshot and… what is that you plugged into the destination pin? No you don’t put that “find look at rotation” node in there. Also if you’re gonna do my suggestion, you won’t be needing that node in addition to “set world rotation”. What’s the difference? If you make the character face the target location in the duration of the travel, it won’t rotate to any other direction if it needs to go around an obstacle. Still, we shouldn’t have needed such solutions, even the one I suggested but we’re doing this because there’s something else going on which we can’t figure out with the given informations. So you can do the quick fix I mentioned, and look back to this topic in the future if needed. Maybe when you create another character from scratch you will see what you did different
I tried in this way, and it’s still missing rotation and also it’s stopping when npc reachs the random point. And It’s strange because on success the same event is recalled.
I’ll try with your first suggestion!
@VisAgilis
In destination pin there’s "Get Rotation X Vector pulled out from “Find Look at Rotation”.
There’re these nodes because i was also trying @doctorpepperdan suggestion.
Theoretically i got what you told. It’s logic and clear! But I’m missing something probably or the problem is in some settings I used for the blend space. Idk. So, I’ll remove the look at rotation and I’ll try again.
@VisAgilis
Hey, did you make it? Just wondered.
Btw I already got that you were trying to implement another fix to your blueprint. I just meant you plugged those in the wrong place
Also I’m really curious on why this happens in the first place. But I think I won’t be able to find out with these limited informations, and I obviously can’t ask you to send every single window in your project so could you create a new npc in a fresh project, place it somewhere in the map and make it move to a location of your choice using the AI Move To node?