Horse Animset Pro Integration

After communicating with MalberS about the possibility of an official integration between Opsive UCC and HAP We concluded that I needed to come up with one.
So I did, and I want to share it for anyone else looking for it.
I have completed a bare bones integration, though I'm unsure if errors occur with various use cases.
Also, the optimizations of the standard UCC may not all be preserved, I am unsure as I just threw it together for my own project.

I would appreciate comments, and collaborators if anyone can see room for improvement.
And if this helps you out, please let me know. That would brighten my day!

Here is the GitHub:
GitHub HAP and Opsive UCC

A video, silently outlining the necessary details:

Requirements: you need to install UCC and set up a character, and HAP. So you need to provide both. Then follow the instructions on the repo Readme to finish the set-up.
Thanks
 
Last edited:
If either of you get it working, or have issues let me know. It's my first time distributing an integration. My two favorite unity assets too.
Check the first post for a video of it working in my WIP game Sky Bridge: Fallen Stars.
 
Last edited:

treshold82

New member
Yeah I got it working - one thing that comes to my mind is that rider.MountAnimal makes a check canMount which sometimes return false so camera switches but player doesnt get to mount the horse.

Also I had to make bit optimization and disable second camera / main camera depending situation since I'm using vegetation studio and have also post effects stack on camera. 2 cameras on at the same time with lot of stuff is a bit resource hog :D.

One thing that is handy when making custom integrations - you can use interact ability with certain object id. Then with the interactable script on object i want to interact i have also this custom triggerer:

Code:
public class interactTriggerer : MonoBehaviour, Opsive.UltimateCharacterController.Traits.IInteractableTarget
{
    public UnityEvent interactAction;
 
    public bool CanInteract(GameObject character)
    {
        return true;
    }

    public void Interact(GameObject character)
    {
        interactAction.Invoke();
       // Debug.Log("CUSTOM INTERACT HAPPENING");

    }

}
So I can use unity event and assign whatever i want to interact in inspector
 
I notice that same thing. You can disable camera rendering on the inactive camera in Vegetation Studio Pro. Is it still bad on resources though?

I noticed the same issue with the onMount script since it is a void method.

Update:
I decided since I knew theoretically how to do this, I would put it to practice, and solve the bugs.
I went to the events section of the MRider component on the UCC character and Call a couple of methods that I have added to the HAPDismount.cs and now all errors are gone, and multiple horses can be ridden with no camera switching flaws.

(y) Enjoy.
 
Last edited:

Maximuz24

Member
@JacobDSiler Hi Thanks for the script but my chatracter is not mounting on the horse and i cant see
"Setup Mount Layer" also Character ik element in the disable component shown in the video. i am using the latest version of UCC. Also i cannot import animation.Please help
 
Last edited:
Hi @Maximuz24 so the 'setup mount layer' is on the rider script attached to your character. It adds a layer to the animator controller attached to your character. This layer has all of the HAP animations.
The IK tweaks are the last part to worry about, and it works without tweaking those values.
 

fetaknight

New member
Hi @JacobDSiler Thanks animator added to my character. But the player is not climbing/mounting on the horse the animation looks wired.see image below.
View attachment 2504
@Maximuz24 , you didn't follow the steps correctly. Your Disable List is not right.

@JacobDSiler I was able to use your implementation to get HAP horses working just dandy, but for some reason other Malbers animals are giving me trouble. From what I can see I've replicated the settings that worked on the horse but these others seem to ignore the rider after successfully mounting so their attacks and quick turns clip through the rider as if the rider isn't parented even though it is. Perhaps its related to the spine straightening of custom mounts.. though disabling that didn't do the trick either. Was there anything in particular you did to the horses in your example scene, or better yet, have you tried the other animals?

*edit: Issue with other animals solved, https://forum.unity.com/threads/malbers-animals.440812/page-22#post-5618056
 
Last edited:

Maximuz24

Member
@JacobDSiler Thanks now my player mounts on the horse but now facing 3 problems.
1, the camera is not following the player.
2, I can't find an event that you showed in the image (Refer attached image).
3, It's possible to provide video for camera setting and IndexOutOfBounds error because after i copy-paste the data as you mentioned its still showing error or the player will not move.I am not a programmer.Please help.

Sorry if it's my mistake.Thanks
 

Attachments

Last edited:
@Maximuz24 , you didn't follow the steps correctly. Your Disable List is not right.

@JacobDSiler I was able to use your implementation to get HAP horses working just dandy, but for some reason other Malbers animals are giving me trouble. From what I can see I've replicated the settings that worked on the horse but these others seem to ignore the rider after successfully mounting so their attacks and quick turns clip through the rider as if the rider isn't parented even though it is. Perhaps its related to the spine straightening of custom mounts.. though disabling that didn't do the trick either. Was there anything in particular you did to the horses in your example scene, or better yet, have you tried the other animals?

*edit: Issue with other animals solved, https://forum.unity.com/threads/malbers-animals.440812/page-22#post-5618056
Really glad it worked for you!
It is a bit hacky, and I plan yo make a proper integration at some point if there is not an official one first.

So glad you found a solution for the other animals as well, because I don't have them so I would also be confused.
 
@JacobDSiler Thanks now my player mounts on the horse but now facing 3 problems.
1, the camera is not following the player.
2, I can't find an event that you showed in the image (Refer attached image).
3, It's possible to provide video for camera setting and IndexOutOfBounds error because after i copy-paste the data as you mentioned its still showing error or the player will not move.I am not a programmer.Please help.

Sorry if it's my mistake.Thanks
I'm happy to help, and I'll work on a video for sure.
So the event setups normally need the string function and you type the name of the function you want to call.
I currently forget the details of which function to call for your current needs, as I'm a bit fuzzy on which step your taking.
 

Maximuz24

Member
I'm happy to help, and I'll work on a video for sure.
So the event setups normally need the string function and you type the name of the function you want to call.
I currently forget the details of which function to call for your current needs, as I'm a bit fuzzy on which step your taking.
I am saying about below step.If i update it as you mention then my playe will not move.and i have concern regarding the camera error fix. Thanks A lot for your reply.

Optional Step to remove the IndexOutOfBounds error: Go into KinematicObjectManager.cs which is a script included with Opsive UCC at the time of writing. Change the code here: private void SetCharacterMovementInputInternal(int characterIndex, float horizontalMovement, float forwardMovement) { m_Characters[characterIndex].HorizontalMovement = horizontalMovement; m_Characters[characterIndex].ForwardMovement = forwardMovement; }

To this code: private void SetCharacterMovementInputInternal(int characterIndex, float horizontalMovement, float forwardMovement) { if (characterIndex >0) { m_Characters[characterIndex].HorizontalMovement = horizontalMovement; m_Characters[characterIndex].ForwardMovement = forwardMovement; } }
 
Yes, the only check is to make sure there are more than 0 characters in the scene. It shouldn't have an effect on the movement, but if you don't add it it should still work perfectly. Try it out and let me know. If your character won't move still, check the components on the character Game Object. Let me know if you shake out the problem, or an error message. :)
 
@JacobDSiler camera issue i solved . but when i mount i am getting below errors and after that i dismount the player cannot jump.
View attachment 2557
Thanks
Hi Maximuz24,
Sorry I did not answer until now!
So, I'm not sure all of the implications of the error you're getting, but if you add an if (array.length>0) check to it, it should resolve the error being thrown in the first place. Consult google if you aren't sure what I mean. That's where I learned it. ;)
 

VintageRoots

New member
I downloaded the Github project but under HAPDismount i dont get any Horse Camera, the only issue im having is both the IndexOutofBounds and the Camera stays in position not following the player, i also get 2 auudio listeners error
 
Top