How to properly ride another character?

Hello,

I want to setup a simple creature-riding system where players are able to mount other characters (refered to as creatures). This system is similar to the one in ARK: Survival Evolved and Far Cry: Primal, if anyone has played those games.

So, where do I handle all of the inputs? Should I have a function that handles moving forward in my only player controller, which performs a check to see if we are riding something or not. Then if we are riding something, add movement input to the mount, and if not just to our player. Or should I be using two different controllers for each character (one for players, and one for creatures)?

Thanks in advance! :slight_smile:

Stefan

The character is a pawn, the creature is a pawn. You actually play with a Player Controller who can posses/unposses any pawn you want.

What you do is that your main pawn (your character) has an interaction ability that lets your player controller know to unposses the character and posses the creature instead. On top of that the character plays an animation of him getting up on the creature. Then the creature has a “get off” action plays a “getting off” animation and tells your controller to unpossess the creature and possess the character again.

Each pawn has their own logic from normal input events, based on their particular needs. You only use input on the controller for stuff that is above the pawns (eg: cursor or menu stuff)

Okay, but what if I want to be able to control my player and creature at the same time? Like riding a creature while shooting arrows with a bow? Which pawn should be possessed?

And also, can’t I just store a reference to the player’s mount in PlayerCharacter.h and make a call to that reference to the creature that I’m riding, and then add movement input when needed?

Anyways, thanks alot for the help! It’s appreciated :slight_smile:

yup, you could just re-rout input to the creature when your character is bOnCreature or something. That’s probably the simpler way to go.

Aah, great! I guess controllers are there to make input-handling easier, because it already stores information about its possessed pawn. But if I can store my mounted creature in my character, then another controller won’t be nececcary I guess.

Couldn’t thank you enough :slight_smile:

well, not only it isn’t necessary, you literally can’t have more than 1 controller per input :smiley:

Yeah I know. Also, when I think about it now, it would be very stressful switching controllers and keeping reference to my player character whenever mounting/unmounting a creature. Much easier to just keep everything inside my player character’s controller. :slight_smile: