So I have an NPC that turns to face you when you talk to them, and that works all fine. But when I want to return the character to their original rotation SetWorldRoation does nothing.
According to the breakpoints and
print strings the piece of code that
should rotate the NPC back is being
run when I want it to (when dialogue
with NPC is closed)
When I run talk to the NPC again
after they don’t rotate back, they
still rotate to face the character.
The code that the rotate to face
player and rotating back are running
are practically identical.
Even when I just set a random set of
numbers in the new rotation section
of SetWorldRotation, nothing happens.
I run the code after setting an
AIMoveTo to nothing. But this doesn’t
change anything when removed.
That is just my shoddy naming conventions I think. In this case, CurrentRotation refers to the rotation of the character before being rotated to face the player. It gets the variable when the code in the green gets first run when the player talks to the NPC. So by setting the CurrentRotation again in the update in the timeline, I’m trying to set it for future use.
But right now I’m not actually using the rotation variables. I made them to try diagnose the problem or just to make the rotator actually do something by setting it to a variable. This didn’t work unfortunately. Turns out even putting a value directly into the SetWorldRotation won’t do anything either.
Also recently discovered that by manually running the event in the editor it will rotate the character, but it will only do it once. Its very peculiar.
Thank you! Yes this code does indeed work as intended when manually called in editor, but not when run on the exit dialogue event. It could possibly be because I am running the code on the parent of the child actor that this is meant to be working on, but the original rotation works…
Well when the dialogue is closed, it runs a BTTask Blueprint base class which tells the dialogue box to disappear and for the first person player to not move. It then Gets all actors of class of the NPC parent class and calls the return event. According to the breakpoints it does get run, but it runs through the SetWorldRotation like it isn’t there.