So I’ve been right on the brink of making a fully working Horseback riding system for my open world VR game, however, my horse’s character blueprint will not fire any inputs received after input has been enabled.
What I want: I want to sit on the horse, and simply click the A button once to go in a forward vector at a certain speed, this way, the player can click A to gallop in a straight line and will still be able to use their hands to shoot a bow and arrow in VR.
What I have completed: I have a character blueprint of the horse set up, with all of the components required already finished. When I grab the saddle, my player attaches to the seat, and the animations bob the player up and down beautifully when they are triggered.
My issue: The horse wont move or seem to receive inputs of any kind from my controllers. I have enabled input from the base VR pawn, the game VR pawn, the VR hand, and none of them fire off inputs when I click the buttons that are set under the “input” tab of the project settings. These buttons are not used for anything else in the game, they will simply be used for moving the horse forward while I am sitting on the horse… I cannot use “possess” because I just become the horse and can no longer use my hands.
Am I missing something? Can Character Blueprints not “receive input”? Or do I have to make a second controller that uses the A button on my VR controller and “possess” the horse with the second player controller?
I know it moves because when I “Add movement input” to the event tick, the horse moves forward as it should. I just simply need to find a way to tell it when to and when not to move.
When horse is first mounted, PlayerCharacter (or player Controller, wherever your inputs are handled) gets a reference to the horse. Make a “Mounted” bool in that same place.
Make an event to accelerate the horse, and one to decelerate the horse, on the horse actor.
Where your A button is set up normally on your player/pController:
On Triggered: A branch directly after the event, checking “Mounted”. If false, do as normal. If true, however, Get your reference to your horse, and as Horse, do Accelerate event.
Same on Completed, but activate the Decelerate Event
Thank you for responding! And thank you for the advice its working well so far!
Just one issue; when I click the A button to fire off the event made in the horse, my cast to the horse’s BP fails every time. The link listed is a screenshot of the player controller’s blueprint here
The issue is I don’t think the horse is the Owner! So that won’t work. What I mean is:
When you activate the horse to mount it, you’ll grab that vehicle and set it as a variable, then instead of “Get Owner” you “Get HorseVariable”.
So like, if you’re using a Trace to get the activation, you would drag off of “Hit Object”, check “Class = HorseVehicle” and if TRUE, “SET HitObject → HorseVehicle”
Then use HorseVehicle (object variable you just set when mounting horse) instead of “Get Owner”!
Hey @Mind-Brain That worked, except I put another box collision on my player character, and used an overlap event instead of a hit event! Thanks for all of your help!