Integration Guide
Last updated
Last updated
Purpose of this tutorial is to explain the process on transferring logic from the example rider to a different or custom character class.
All reference calls in BP_Horse, BP_Rider and ABP_HorseRider have been coded to work strictly through the interfaces. This approach enabled relatively seamless code transfer to new character classes without requiring to re-do all reference calls.
Before anything else, you need to add the BPI_Horse Riding Interface to your character class and then recompile the blueprint.
Next, you need to copy code from BP_Rider into your character class. Picture bellow highlights the nodes which are crucial for the horse Riding framework All of red commented code handles standard character (while not mounted) input and movement. Assuming your custom character already has input and movement framework in place, all red code is redundant. Blue and Grey code handles references and tick logic, while orange does animation related events and green oversees function calls that affect character states and function calls to other classes.
Just like the highlighted area in the picture bellow, you want to copy over all code except for
PURPLE and RED nodes into your personal character class. Once you did that, recompile the blueprint once again.
After you compile your character class, you will receive errors complaining about non existing variables. For that you'll have to right-click on each Erroring out variable and Create that variable.
Once you did the all, your variable tab look like this
You also need to connect the Begin play Ref setup and Tick Events nodes to your class Begin play and Event Tick areas.
Great, now that you did it, compile the blueprint again and move to the next stage.
Next step is to implement and connect all the Interface events. All Yellow interface events with Rider Affix should work out of the box after you copied over the code from the Example Rider class into your own characters Event Graph.
This leaves us to connect remaining (affix) Get_ and (affix) Is_ interface calls
Connect the required plugs in the interface calls like this
Next step is to connect the animation logic (specifically Riding animation states) to your Animation blueprint.
We start the same as for the character class. Open your characters Animation blueprint and add the BPI _Rider ABP Control interface to your ABP class and hit Compile
Similar to BP_Rider code transfer, you will need to open up ABP_HorseRider and copy over highlighted nodes (example picture bellow), then Hit Compile again.
Just like in character class, you will have a lot of errors warning you about missing variables, you'll have to go through each of the missing ones, right click the node and create those variables.
Additionally, this will include having to recreate all the variables used to Drive animation states in the state machine. It will pop up as errors / warnings in your ABP compile log, just like for the standard code variables, you'll have to go through every single one of them and recreate them.
You will most likely have some logic connected to these nodes bellow, but you need to connect the Reference setup node to Event Blueprint Initialize Animation as well as Update Animation tick Events to Event Blueprint Update Animation
Then, we need to connect the
Grey Interface calls. It is recommend that you still go through all the yellow ones to make sure they all got properly carried over when you copied the code.
Connect the appropriate variables to these interface calls just like in the pictures bellow.
Now we need to merge your existing code with the Horse Riding logic in the AnimGraph
You will want to copy entire AnimGraph as is from the ABP_HorseRider onto your ABP
In there, the green commented section is the original Epics 3rd Person template character movement. You can disconnect it, and plug your existing AnimGraph Setup (whatever was originally going to the Output Pose node)
Your character may differ in size to the original demo character, in which case, he may not socket to the horse in an ideal position when riding it. You can modify the socketing point by opening up the SKEL_Horse skeleton asset and modifying the RiderSocket location to better fit your character.
That's it! Assuming your character was running on Epics UE5 mannequin Skeleton, your transfer process is complete and you should be able to mount and ride the horse with your personal character actor.
ATTENTION - This section is only relevant if you're using a different skeleton for your Human Character
For this to work with a custom human skeleton, you will have to take few extra steps to make it compatible.
To begin, you need to re-target all humanoid animations to your new skeleton
You can use the RTG_Mannequin IK retargeter provided with this pack
You need to retarget all 21 Rider Animations to your new skeleton. (AnimMan is just an example retarget asset if you're retargeting this to ALS package)
You also need to recreate BS1D_RiderMovement blendspace with newly retargeted animations (follow old blendspace asset as a reference)
Then you will have to replace all the animation nodes inside your Animation Blueprint with these new retargeted animations. You can do so, by click dragging the animations from Asset browser window within ABP
And drag-dropping them onto the Animation Nodes you want to replace
Once you did this for every animation state and animation node within the ABP, you're set. Hit compile blueprint and your character should be ready to go and mount the horse.This is the end of this guide!
Thank you for purchasing and using our Horse system package. We hope this guide was useful to you and we would appreciate if you could share your experience with this pack in a form of a review on our marketplace page
Have a great day!
Additionally, it's very likely that your character has some form of logic running on tick already, maybe it's IK correction for hands and Feet, maybe it's some form of offset. Regardless, you don't want any logic running on your ABP tick when Rider goes into HorseRiding mode. Which means, you have to branch all your existing Event Tick logic when your character enters Horse mode (except for the Tick events that you just copied over, those ones are intended for horseriding mode). It is recommended you use this node to do so
Select Rider animation assets and Right click on them to get context menu and choose Retarget Animation Assets