These are a few frequently asked questions about the Mounting System.
What problems does the Pro Networked Mounting System solve?
You may ask yourself, why was this built? A few years ago I would have wondered this as well until I was working on a networked game that needed us to ride a horse. Turns out building a networked mounting system was way harder than any of us had thought. First attachment replication is not very reliable at runtime. Second, lag in multiplayer games introduces a lot of issues and every multiplayer game has a small amount of lag constantly. Third, you should never use reliable multicasts in large world games and this requires a strong understanding of Unreal Engines replication system to solve. This plugin solves these technical issues in a uniform way that allows any Pawn or actors to become mountable.
I also wanted to build a plugin that was of a professional grade, using the knowledge I have gained as a software engineer over the many years of my career and provide a mounting system that you could ship your game with.
From a functional point of view the plugin primarily help you set your character into a "seat" on another actor and helps facilitate taking control of that actor and returning control back to your original pawn. Its core functionality is mounting, dismounting, and seat changing in single player and multiplayer games.
Is the Pro Networked Mounting System easy to setup?
Easy is a relative term, for a mid skilled programmer or someone knowledgeable about in UE4 blueprints the answer is yes, the setup of the PNMS should be easy. It may however take an hour or so the first time you do it for your project. There is a great deal of customization and flexibility in the PNMS system that can lead to issues if not properly configured. You have many options in how to handle mounting, dismounting, seat changes, and moving into position which are all 100% optional.
Is the Pro Networked Mounting System Compatible with (XYZ)?
The short answer is yes. The PNMS is primarily a plugin, it does not come with any blueprints or animations that are required to use, it does not make assumptions about the types of the Riders you use other than they should be Pawn types, it does not make assumptions about the types of your Mounts other than they should be an Actor types, and does not make assumptions about the hierarchy and components of either your rider or mount. So there should not be any project that is incompatible with the PNMS plugin.
That said there are countless starter kits and and complete projects on the market place an I cannot test them all. I have yet to find one that I cannot integrate with. That said, please do not ask me for help integrating with a particular kit, I simply do not have the time or the funds to test them all. I will gladly answer questions pertaining to the PNMS system, but very often problems from integrations are more due to missing knowledge about the particular kit being used rather than the actual plugin itself. The biggest offenders tend to deal with how a kit handles interactions and animations such as turn in place, these are unique to not just the kits but to game projects in general and so the plugin cannot account for all scenarios and requires you to learn how that kit works and make the adjustments appropriately.
Are Root Motion Animations Supported?
If you are building your game as a single player experience then yes, you can root motion your mounting, dismounting, and seat changing animations. However when dealing with a networked game, where a small amount of lag is always present, characters can move while mounting and dismounting, the attachment logic in UE4 can get a bit funky. For this reason I highly suggest not using root motion for your mounting and dismounting animations. Instead build the animations from the perspective of the player capsule being already attached to the seat for both mounting and dismounting.
I am still working to refine this bit and improve fidelity of the system.
Is this plugin compatible with SGK?
Yes, This plugin should be compatible with any other plugin or game kit on the marketplace. I have successfully integrated it with the market place Survival Game Kit (SGK). You will need to hook in to the SGK interaction system, but it does work. The SGK is not an Epic product nor is it one I have developed, so I am not responsible for helping integrate the PNMS with it.
Are there specific classes required?
My goal was to allow you to define any Pawn class to be a rider that can be attached and detached from the a mount or vehicle. This way using the mounting system did not rely on you specifically using the ACharacter or a special character class imposed by the mounting class to be a base class.
Then I wanted any Actor class to be a mountable object by your rider, but it is important to note that only Pawns can be possessed by controllers in Unreal Engine. So “driving” a non pawn class will require some manual setup on your part.
Why is my passenger able to rotate in its seat?
This is something that the plugin will not address because it has everything to do with how input is handled by the pawn and player controller. There are a few ways you can handle this from blocking rotation movement input while mounted disabling Rotate Towards Input on the Character Movement Component.
An Example of blocking movement can be found on current C++ and Blueprint Demo Projects
Why does my mount keep moving after I dismount?
This is an issue with UE4 possession logic itself. The easiest way to deal with this is to have an AI controller take possession of the mount after the character Dismounts. Current versions of the Demos implement this in the example project.
Why is my character sitting sideways?
The attachment system of the PNMS is completely dependent upon the socket orientation. Also one thing to remember is the Unreal Mannequin is built facing the wrong direction, instead of forward it faces to the left or right. The Third Person Character corrects this by adding a -90 degree rotation around the Z Axis on the Skeletal Mesh Component. So if you are using the raw mesh to adjust sockets in the Skeletal mesh viewer you'll need to turn them so that the character is looking left or right instead of forward.
Why after Migrating to my project I cannot interact with the vehicle?
Why after dismounting is my Pawn rotated 90 Degrees?
This was one of the central problems with building a networked mounting system in UE4. Handling the relative offset between the capsule and the skeletal mesh on ACharacter actors can get weird for reasons unknown to myself.
To ensure Animations, Lag, Movement and Attaching/Detaching does not cause strange offsets in rotation and location the mounting system performs a sort of reset on the character's skeletal mesh when it dismounts and uses two properties on the MountRiderComponent to do so; "RelativeMeshLocation" and "RelativeMeshRotation". These values are Zero Vectors by default but should reflect the values of the Skeletal Mesh component's Relative Location and Rotation to the Capsule Component. They can be read and written to in Blueprint so you can make systems that change these default values at runtime if need be. There currently does exist a method to automatically update these values, but it is prone to accumulation of Error and I will be removing it in the next version of the plugin (2.0). So Manually setting these is best, but you can also use your Pawn’s Constructor to auto update them on the component in C++ or Blueprint.
Why Am I not possessing My Vehicle?
- Make sure IAdmUnifiedControllerPawn Interface is implemented on both your character, your controllers and your vehicles
- Make sure IMountRider Interface is implemented on your Pawn
- Make sure IRiderController is implemented on your Controller
- Make sure IMountablePawnInterface is implemented on your Mount.
- Make sure Possess Character function is implemented
- If multiplayer game, the RPC for character possession must be setup
- Make sure you have at least one seat designated as the Driver Seat on the mount
- Make sure you have "Get Seat ID" Implemented on the Mounting character "IMountRider" interface. For UE 4.25 plugins or newer.
- Make sure the IMountablePawnInterface function "IsDriverSeat" is implemented on the Mount
- Make sure the "IMountRider" interface function OnMountingPawnFinished is being called somehow, such as using "AnimNotify_MountingFinished"
- Check the output log. I have tried to put as many warnings and error notifications as I can to help developers debug the the PNMS.
- If all the above are fine there is a 95% change that the problem lies in the kit you are using.
My player has died, why can't I get back on the mount?
This is most likely caused by the player controller still believing it is mounted as well as your mount still believing the desired seat is occupied. When you kill a character while mounted, add a few lines in the player controller on the server to perform some cleanup operations.
First you will need to clear the seat data on the mount.
- Get the seat data of your pawn. You can find this by calling the pawns MountRiderComponent.GetCurrentSeatData() function or MountRiderComponent.GetSeatId() function.
- Then Get the mount from the controller and call MountablePawnComponent.ClearSeatById( seatID )
- The Controller should still have a reference to the mount you can use by calling ControllerRiderComponent.GetMount()
- Then you can get the MountablePawnComponent using the interface function "GetMountablePawnComponent()
Now that the mount seat is cleared, you can safely clean the controller.
- Simply call RiderControllerComponent.Reset()
If you are respawning the pawn when killed then you do not need to do the next part. However if you are reusing the old pawn instead of destroying it, then you will also need to clear the pawn's component data as well. This is as easy as doing it for the controller
- Call MountRiderComponent.Reset()