Two issues with player pawns

Hi guys,

I have been working on a mod to switch the default character meshes into custom ones.
What I have so far is working quite well. I replaced the default PlayerPawnTest with my own and added in some variables to point to the new mesh for each player depending on a name. In the Possessed event, I check the player name against a listed name and set its index in a replicated variable, like so:

In the associated event for this index variable, I set the mesh and materials for the player pawn:

All is working quite well, also in dedicated multiplayer. However, there are two problems I have run into that I am having trouble solving.

The first is that, only when playing on a dedicated server, the newly created characters are no longer able to hit anything (applies to all hits from melee weapons/fists, to both creatures and resources). The hit seems to trigger properly in single player, since the visual effect is there, but the character cannot deal damage or harvest anything. This is not an issue in single player.

The second problem is registering clothing masks for the changed materials. At the moment I am using an optional workaround method, where it is possible to not override a specific material, such as the body material. This means that it will not be set however, keeping the original character material for the body skin. Since clipping through clothing happens quite a lot (especially when riding), I would like to be able to fix this properly, without giving up custom materials here.

In both of these cases, I am at a loss of how to solve the issue. I would appreciate any feedback or suggestions.

Regards,
Ignifex

On the “not hitting” issue - when I was working on a dino mesh, I found that the “hit” event was being triggered in the dino’s attack animation. One I added that event to the new animation - the hit started working… might be the same thing here… check the original animaions for any events in the animations

Thanks for your reply. That’s quite insightful. In your case, did the animation without the “hit” event still cause the visual feedback of the hit for the client?

I am not changing the animations at all though. If as you say, the event in the animation should trigger the “hit”, then only swapping the skeletal mesh should not have an effect on that. It is also odd that, in my case, the hit seems to be registered on the client, but not on the server.

Just a quick update. I managed to solve the attacking issue by adding a SwitchNetAuthority component in the “OnRepCustomCharacterMeshIndex” event. The dedicated server option is then linked only to the scaling part, making sure the mesh/material setter code only runs on clients.

I have not yet managed to solve the issue with the clothing masks though. I am still looking for a way to get the right mask texture to be applied on the newly assigned character material when equipping armor. Is there an event I could use here, so I could do it myself?