Hello. I am trying to do something like this: I want to create a “copy-cat” character of sorts, a pantomime if you like and I have the following approach (in UE4’s 3rd person game mode template):
- Perform a simple action or two (i.e. jump), move about a bit etc.
- Then a second character acts the exact same thing
I have tried the following that works in my main character’s blueprint (combined with custom C++):
- I create a SECOND Player in the game, who gets assigned the next available PlayerController Index.
- I spawn a new character of same class. As far as I can see, I don’t need to explicitly possess the new character, because everything is set up in the defaults in my GameMode class.
- Then I set up a loop in blueprint with recorded actions which get executed via calls to customized C++ code in my character’s cpp. It literally is based on the generic cpp file that comes with the template and uses the exact same AddInputs AddControllerYawInput/Pitch etc. etc. This seems to work near flawlessly (if not 100% accurately actually! really fun to watch).
However! I initially thought (and tried to implement unsuccessfully) that the more logical approach would be to:
- Spawn an actor of class PlayerController (have also tried a blueprint derivative of that as well, with practically zero modifications)
- Spawn an actor of identical class as main character Explicitly have the second playercontroller (or derivative blueprint class) possess the second character
- I feed through the list of actions/moves to the second Character The Character C++ implementation acts out the same stuff (movements, turns, or jumping).
The second approach nearly works ok, EXCEPT YAW IS IGNORED! Why? (I’m suspecting also pitch but that doesn’t affect character’s movement on the horizontal 2D plane so for now not a pain but still a concern!)
If I only use w,a,s,d and jump etc and then replay, the pantomime character will act out correctly. But if with my main character I use the mouse and point around and direct my guy’s forward direction that way, the pantomime completely ignores that. I am going with the default “Orient rotation to movement” in all cases by the way and I’m fine with that for now (may consider other options), but it just scares me and frustrates me that I don’t understand why this isn’t working they way I expected. I could get tripped up in the future if I don’t understand what’s going on.
I have seen dozens other posts with similar issues, but i’m afraid I don’t understand why the first approach works, whereas the second doesn’t. There must be nuances here I am missing.
Any help much appreciated!