playMaker

Author Topic: Character mounting horse problems  (Read 1643 times)

sgemmen

  • Playmaker Newbie
  • *
  • Posts: 3
Character mounting horse problems
« on: February 09, 2016, 02:36:54 PM »
Hi all,

So... I have a mage mounting a horse. Basically three separate game objects. I have my mage. When I press a key he deactivates, then a second object (a duplicate mage) activates and initates a "mount-up" animation and another game object, the horse, activates underneath of the mage as he finishes mounting up. My problem, however, is that when I finish mounting up the horse runs/gallops a few feet then studder steps. I'm not sure what the problem is--perhaps the animation is running off the parent animator controller? I tried running a "Play Animation" in play maker but that does not work either for some reason. Anything thoughts on how I can do this better or eliminate the stutter-step of the horse?

sgemmen

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Character mounting horse problems
« Reply #1 on: February 20, 2016, 12:49:38 AM »
*Bump* Alright, I have some progress, but not much, ha.

So I realized that I don't need play animation, but animator play since I'm using the new animator controller.

I need to have my mage mount up on a horse and then be able to control it.

Any one willing to help walk me through it?

Zeldag

  • Full Member
  • ***
  • Posts: 198
Re: Character mounting horse problems
« Reply #2 on: February 20, 2016, 09:56:36 PM »
Really not sure about the issue you have, but if youre having issues getting animations to work make sure you have the mecanim action pack.

It can be found here: https://hutonggames.fogbugz.com/?W1031

Now as far as walking you through it, im a noob, but I like a puzzle and have time to kill, so ill take a guess at it. Worse case scenario it may help you brain storm lol:

The way I imagine a mounting done is (as a noob):

Character walks up to horse object and enters a sphere collider trigger around the horse.

When in this trigger pressing a button will mount the horse.

So you should have your character game object, a horse game object and a character on horse game object- all saved as prefabs.

The character and the character on horse should be animated and programmed (via playmaker of course, lol or not if that is what youre going for) to be usable and controllable independant of each other. So basically youre creating a character and a horse riding character.

On the player animator set up a transition from 'walk' and 'idle'  animations (or states) to the 'Mount' animation (state). Make a new parameter, type = 'trigger', and call it 'mounting'. In the transition conditions; put the trigger 'mounting' as a condition (from both 'walk' and 'idle' to 'mount').

Character enters the horse trigger.

Character has fsm:
State1- trigger event- enter tag: 'horse' (store collider and send State2)
State2- get key: space (Send3)
            - Trigger event - exit tag: 'horse' (send state1)
State3- Set animator trigger: 'mounting'
            -Wait: 2sec[or however long your mount animation is](send state4)
State4- create character on horse game object on horse's position.
           -disable/destroy the stored collider (which should be the horse).
            -disable/destroy character.

Now you should have a character that will be riding a horse. Reverse the above for getting off. You will need a getting off animation and set up a getting off trigger and transitions.

Also setup an fsm on your camera, so it switches the object it is following or include this in the last state of the fsm i described above.

Best of luck and sorry for the ramble, hope it was useful. Let us know how it goes...
« Last Edit: February 20, 2016, 10:00:04 PM by Zeldag »