Changing Movement Mode affects other characters
I'm working on a game where you can switch between 3 characters at any point during runtime. The 3 characters are children of a master character BP and share the same functionality. This master character BP is based on the ThirdPersonBP from the normal template.
I have a CharacterSelect blueprint with the following functionality:
On Event Begin Play I get the references to all characters in the level like this:
Then when the Player presses 1,2 or 3, it possesses the appropriate pawn:
I also have a simple water blueprint that changes the Movement Mode of the Character on overlap:
Here's the issue:
When Movement Mode for one character changes, the Movement Mode for the other 2 changes as well as soon as I possess them! If I jump and switch in mid air, the character STAYS in mid air. If I set the Movement Mode of one character to Swimming...the Movement Mode of any possessed pawn will also change to Swimming.
Is as if the Character Movement that I reference is changing at the parent level and not the child level (even if I specifically reference the child)
Please take a look at this 1min video to see what I'm talking about: **Youtube Video**
Can anyone tell me what Im doing wrong here? I want to have one character swim, while the others walk / jump independently.
Really appreciate any help!
asked Jan 13 '17 at 06:01 PM in Blueprint Scripting
In the definition of
So, your result is not surprising. The ACharacter parent class stores the movement mode in a static class variable that would affect any and all instances of the class or any subclasses.
I don't know much about the networking side of C++ (yet), so I couldn't say if they really need that variable to be a static class variable in order for it to replicate across the network, but that's what's causing the behavior you see.
answered Jan 13 '17 at 07:12 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here