CharacterMovementComponent Parent And Child

i made BaseCharacter With CharacterMovementComponent
and made a child BPs PlayerCharacter and NpcCharacter

i can play like this normally but i found that if i do this function : CharacterMovement->SetMovementMode

it effect both player and Npc
it should effect only player component if player sets MovementMode if i did right
but it effects both

if anyone knows the reason please reply and solution if you can

Change the setting in the player character, not the basecharacter?

yes basecharacter… and i think i need to make movementcomponent to player and npc not base character

No, player character? :slight_smile:

The movement component can stay in the base character, but make the update in the player character.

i see i can try that i am updating that in base character now

1 Like

it’s same looks like they use same movement component

1 Like

Just checking, so you set the movement mode, in the player character?

yes

1 Like

Strange…

but if this case if npc moves by ai player needs to move as well but it doesn’t

How did you make the children from the base character?

base character with character
and i did mouse right click and create child blueprint class

1 Like

well…i am going to remake everything and i am not gonna inherit anything -_-; just player and npc

it’s lucky i found it early if i find it far later that will be disaster

1 Like

You can ensure that only the player is affected, you should override the SetMovementMode function in the PlayerCharacter class and ensure it’s only modifying the player’s movement mode. This way, the NPC’s movement mode remains unchanged. mydestinycard login

i think i made code works that way

i was making swimming mechanic and i had that problem

and i was making mistake in the logic lol

after changing it works fine with set movement mode to swimming

no set movementmode to Swimming still make the problem

i needed to use flying instead that has same effect with no problem

if anyone has this problem this is one of the solution

I just tried this.

I make two children of the first person character.

I can change the movement mode of either of them and it doesn’t affect the other. I can possess either and move with the mode that I have set on that one.

did you try swiming

i did this set water volume = true and set movement mode to swimming

Where do you set this?

Ok, character movement…