1. The space forums use a separate registration system from the main virtual world. To comment on these forums, you need to create a separate forum account.
    Dismiss Notice
  2. Hey there, we have two Skype groups for space early users - if you're creating content, or need help, feel free to join in either the the beginners or advanced users groups.
    Dismiss Notice

Horse vehicle

Discussion in 'General' started by Teager, Oct 13, 2016.

  1. Teager

    Teager New Member

    I'm trying to set up a horse vehicle with the car vehicle component script, and I need a little help getting started. I'm not sure if the car vehicle component is capable of animating an animal vehicle yet, but I figured I'd give it a try - no time like the present for pushing limits and blowing things up. :)

    1. The wiki says to add wheel colliders to the wheels, but since I don't precisely want the horse's legs to act as wheels with regards to rotation and tilt, I've just made the body collider cover the whole horse. Not sure if this is correct.

    2. I'm confused about how to set up idle and movement animations, since the component has transforms divided by each of the 4 wheels, and I am animating the full body. Should I drop movement animations in one of the four slots and leave the others blank?

    3. Is this component able to apply a new animation for each gear, or is that something I'll need to wait for the sdk to accomplish?

    4. Currently, clicking on the horse vehicle has no effect on my avatar. It doesn't move into or on top of the horse, and doesn't play the sit animation I assigned to it. I'm also unable to cause the horse to move, but I'm guessing that may be due to skipping the wheel collider and/or not having changed any other variables in the car vehicle component.
  2. Adam

    Adam Developer Staff Member Moderator

    I would follow the general steps to turn it into a car - including wheel colliders, you don't actually need to have them visible however; but they are used for locomotion (so without it, the horse simply wont move), in terms of animation; I'm adding a new component to the editor packs which will translate velocity & torque from vehicles into a animation parameter, which you can use to drive the animations properly.

    This might need a bit more 1-on-1 advice to look into properly, but I'd start trying to get it up as a normal vehicle following the car tutorial on the wiki/youtube channel, and then try deviate from there once it's behaving.
  3. Teager

    Teager New Member

    I took another stab at it and did add some wheels with the wheel colliders, and attached them to the vehicle script. I tried using cylinders at first, but when I hit play they fell on their sides so the flat surface was down and the vehicle could not move. So I replaced them with spheres to be sure they could rotate.

    When pressing play again, the horse vehicle still couldn't move. Despite setting the box collider high above the spheres, the horse's bounding box appears rotated forward so that it blocks the front wheel. In case this was the problem, I tried going simpler with a cube and some spheres.

    Now when I hit play, I notice that not only can the vehicles not move, the avatar cannot move either. Play mode seems to think that my playerchar is already sitting in both vechicles when I hit play; using arrow keys or wasd causes my camera to zoom in and out without the playerchar or the vehicles moving.

    Also when I hit play, I can see in scene view that the wheels on both vehicles are freely rotating nonstop.

    https://www.dropbox.com/s/emil7325fymtuy4/space cube car.jpg?dl=0

Share This Page