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:
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!
Sorry, I’m not going to be much help in this area. However, you could really make one unique game with those “features”
Found this on answerhub, but it’s yet unanswered: https://answers.unrealengine.com/questions/391306/how-would-switch-between-multiple-characters.html
Edit: Also found this, which might be worth checking out: https://answers.unrealengine.com/questions/128192/how-to-make-the-character-keep-falling-when-not-po.html
Thanks for the links Amsirahc. In one of the threads they solved my “falling problem” by checking “Run physics with no controller” on the Movement Component. I also tried assigning an AI controller and that worked too!
I’m still having the issue of the Movement Mode being shared between characters. I got an answer from another user in the Answer Hub - it looks like the Character class shares its movement mode among all children. If this is the case, then its not possible to have a character swim while another runs :(.
If anyone has found a workaround for this, please let me know!
Glad I could at least help find a partial solution!
That really sucks! Are you able to change your Cast to ThirdPersonCharacter to Cast to Player Character (your child actor class)?
I tried changing the cast to the individual characters (children) and it didnt work. I even tried resetting the movement mode on character switch and it didnt solve it either. I decided to restrict the switch only when all characters are idle to avoid the issue. Not the best solution but it works for now :(.
Here is the end result, if you are interested:
If anyone is interested in getting the code to do this, you can download the template and take a look at how I solved it - https://forums.unrealengine.com/showthread.php?125187-FREE-ThirdPerson-Action-Platformer
I’m bumping this thread because this bug still exists. In my case, I’m setting the player to Swim when entering the swimming volume. The bug is that it sets ALL players to swimming, even if they’re not connected (connecting clients have their movement mode set to Swimming over and over).
So the bug is that when the Movement Mode is changed, it’s affecting ALL clients in the game. I’ll submit this later, but it’s really easy to test for yourself, I got this bug happening on a new blank project.
Well, I have the same problem, struggle long time with it and found finally what that bugs happend and how you can make a workaround
First of all if you set only 1 Character in your scene to swimming and as example your Main Character is fallling (by spawning in the lvl by current camera location) it switch automatic from falling to swimming. Even if you start at “start point” if you jump and fall after it, it switch automatic to swimming.
The only workaround I could find until now is to disable “Can Swim” in the Character Movement Component of your BaseCharacter (Parent Class). Even it is disable you can set your Character to swim or not swim by setting the water volume and Set Movement Mode to swim
Hope that help you guys!
ps. Even in the Unreal Engine 5.0 its not fixed
Omg thank you! This has been driving me mad all week! I debugged all my state machines and code but couldn’t find anything. Such an oversight with the new water system being tested by a lot of people. I’ll try to submit another bug report regarding the issue.
I found an older bugreport that mentions Epic won’t be fixing it.
This is going to sound weird but it works. Instead of changing movement mode to swimming, change it to flying and don’t set the water volume. I achieved the same result of swimming by using flying instead. Hope it helps.
This worked for me. Thank you so much!