As part of my game I’m attempting to attach my player to a Dragon (Weird I know). However I have more that one type of Dragon, and therefore they all have different sizes. I’ve created “Mount Points” on the Dragons, one on the middle of their back (The players pelvis will parent to this), one on each side of the body (The players feet will parent each point, one for left, one for the right). The hands will then parent to the hand points.
I’m not very good at scripting, and this is all I can think to start the script…
Saying that I attach this to every mountable character in the game…
var LegLeft : Transform;
var LegRight : Transform;
var HandLeft : Transform;
var HandRight : Transform;
var MountPoint : Transform;
function OnMouseDown()
{
//CODE GOES HERE
}
Where would I next go? I know I have to parent each joint, but how do I make it bend? Here’s an idea of what I want it to be like:
Red = Player Joint
Blue = Mountable Character Joint
I also want to use variables, so that I dont have to create a script for every single character. By dragging the mount points onto the editor I think would make it a lot easier.
It would be a lot less code to just use a couple of different animations for your player. Then when mounting, your character at that time can check for the type of dragon its mounting then pose the correct animation. Unless your having a lot of movement to the dragons back you shouldn’t need to do any mounting/parenting of the hands or arms, just the hipbone. Think about it, there isn’t a lot of movement besides bouncing around when mounted in Oblivion or WOW. You have to get off your horse to fight. If you have a good modeling/Animation program you shouldn’t have any problem animating both the character and dragon at the same time.(ie) After you get the dragon animations done. Merge a copy to your program with your character open in it and mount it and do the animations. Then delete the temp dragon that helped you get the animations looking right and that should work. As far as code goes, it depends on how detailed you want to get.(what kind of mounting system you will build) (ie) in WOW you do a flip for land mounts and for air mounts you just take off on one, for the most part. So if you are having something more detailed than that like see mount after summoned/seen then turn and walk towards it, then head towards it playing walking animation, then at certain distance cross to climbing/mounting animation, then when close to the mount point make child of the mount point. ect
So what kind of system for mounting you going with, I like the GTA mount for motorcycles where the jump over the bars and kick the rider off and land right in the seat and drive away. lol
That’s summed it up a bit Black Mantis. But the whole point of why I posted it was to get help with the scripting. I dont want to animate each individual player because that just takes time. There are over 100 individual characters for the game, having “Mount points” on players would be a really easy option.
I’m going to go out on a limb here and say that, in practice, you’re probably not going to need more than two animations. At the end of the day there just aren’t that many different ways of straddling a mount. Oh sure I know from experience there are different styles of sitting on a motorcycle, but for a mounted creature saddle shapes are fairly common. My guess, as soon as the saddle is taken into account, most of your transform positions are going to be pretty close to each other.
In case they aren’t, my second guess is that you’re overthinking having to position all five joints, and could get away with just three - the pelvis,and the two feet. It’s my understanding that the bone systems you’ll have in place for a biped will automatically snap the joints inbetween using IK, so long as you can position those three correctly, the rest of the lower body will follow.
Also? The idea of hijacking a dragon? Most awesome thing I’ve heard so far this year.
Well, like I said there’s over 100 characters in the game plus about 150 creatures. All the creatures are different sizes and therefore I thought if i created a Mount script I could easily add a mount feature to any creature without having to animate it.
Oh and thanks for that, it kind of works with most creatures in the game. Although maybe not so much with the giant rats, after all, who wants to ride a giant rat around?
maybe instead of using that, you could use transform.position in an update function. I worked for me, but then i was only mounting the cylinder to a certain position. In theory, though, it should work?
All you have to do with the animations is (after posed for mount) open or close the arms for the type of mount that the character is on. Anything you do with 100 characters and 150 creatures will take up a lot of time lol. Even the games i pay good money to play don’t have that many characters/creatures. It doesn’t take long in any game to see that they cut corners for the same reason we all do time, money, performance, so that’s why there are so many tricks to hiding things and cutting corners. We all could make the ultimate game if we had 20 years to do so. I coded a pretty good size inventory script not long ago where the character needed armor and weapons and clothing mounted to over 25 places on the body. So i used child and parent style of transforms and even though it worked out, i wanted to scream a few times lol.