i have a level with two characters placed during designtime. I possess one of them, with player 0 controller. From that char, i wish to send controller input to the second char, so i can control it via the 1st char. This works fine as shown here:
However since i need to change levels dynamically, i need to spawn the two chars during runtime. Once i do that, that same logic doesnt seem to work anymore for some reason. Can someone explain why?
from the MoveForwardP2 i can debugprint the value of Axis Value, and when i press a key that should activate that event, it fires a 1 as expected, but i don’t get any movement. So really the question is, why does this logic work when chars are existing in designtime, but not when i spawn them manually during runtime?
Then to see the example that i can’t get to work. Open up the level-blueprint and switch the executionpin to top flow (grey guys). Then u’ll see, only the main char can move.
Seems like it needs a controller somehow, even though it’s not being used.
Hope someone can figure out what detail im missing.
Can you start with a new map, drag two instances of the Pawn into the map and still get a working setup? If not, the instances in your original map probably have some default values manipulated that allow them to work as intended.
Since it seems like a more complex situation, a size minimized example project would be nessecary for more useful investigations.
Found the answer with help from @Adriel on Discord. Thanks mate.
The name of this well-hidden checkbox solved it. If you hover the mouse over it, it does infact say:
If true, movement will be performed
even if there is no Controller for the
Character owner. Normally without a
Controller, movement will be aborted
and velocity and acceleration are
zeroed if the character is walking.
Characters that are spawned without a
Controller but with this flag enabled
will initialize the movement mode to
DefaultLandMovementMode or
DefaultWaterMovementMode
appropriately.