I am spawning and posses a character actor. When the player character is spawned it is always facing the forward vector. I would like to have continuity with the rotation. However if I adjust the possess settings to inherit the rotation, it breaks the controls. I saw another post about this that suggested reset the player controller rotation. That didn’t seem to work or maybe I implemented it incorrectly.
I am also trying to get the character to inherit the momentum as well as the rotation instead of resetting when the other character is spawned. Video showing the problem.
Hey there @TinyTracker1! May I see how your controls are set up? For many characters using character movement, you’d probably use Add Movement Input which takes world location direction, and have “Orient to movement” checked off on the movement component to turn the character. Effectively making movement decoupled from your current forward direction. This would let you rotate as they come in and shouldn’t cause the same effect in theory.
The camera is stationary with a camera boom. Flip flop posses on empty player controller.
Also. What is the smart way to update enemies about the possess change? Initially I had it set with. OnBegin. But that will fail on possess change.
Is it okay to get the player pawn on a tick or is there a better way?
I’d probably use an Event dispatcher specifically for that. Basically have all of your enemies subscribe to an event that you call on your player pawns whenever they get possessed. Make sure to that the event dispatcher has a reference to the player actor passed through it. Much more efficient than on tick.
Your movement setup shouldn’t shift if the actors come in at the wrong angle from what I can tell. guessing the possession itself has something to do with it there. We could be hacky and just offset the control input rotation by the amount different from the last one, but that’s not the best way to handle it.
Okay how does the hacky method work?
I guess a different approach would be to not spawn the other actor just keep it hidden. But that is a junk solution. I’m a bit surprised the character actor doesn’t allow control of the settings for “orient rotation to movement”.
So how hacky depends how fast you need to swap actors. let’s try a quick test. If you spawn it straight, possess it, and after the possession, increase turn rate and turn it instantly to the control direction and see how bad it pops. If you could spawn it without visibility then enable the visibility after the input turns, you can make it somewhat instantaneous. This is definitely not the cleanest way.
If I understood your constraints a bit better I might be able to write up something a little less hacky. How fast do you need to kill then possess the new actor? Are they always going to be in the same location? Do we need possession or can the camera itself be the “player” and pass out inputs?