Forum rules - please read before posting.

Draggable rotating wheel (curve track or hinge track?)

Hello, I'm having a hard time to get a draggable wheel to work properly. First I tried with a hinge track, but I had the problem that at a certain point the wheel would spin fast in the opposite direction, as though it was rewinding, even though it was set to Loop. I tried changing various variables, and then I tried using a curve track instead, but it isn't working better. I've attached a few images plus the video of the erratic dragging here: https://imgur.com/a/EP1GnT3

Comments

  • For a wheel that turns, use a Hinge Track. A Hinge Track is intended for objects that only rotate, while a Curved Track is intended for objects that translate along a curved path.

    After switching back to this track type, try these two other steps:

    1. Disable (but don't remove) the Draggable's Sphere Collider component, and add a new Collider that more accurately represent's the wheel's shape. This'll likely need to be a custom Mesh Collider, since Sphere/Capsule Colliders have curved ends that aren't suitable for a flat wheel.
    2. Set the Track's "Movement input" Inspector field to "Cursor Position".

    See if things improve following these, and let's take it from there if things still need work.

  • I can add a mesh collider to the child wheel object, but I can't just copy and paste it to the empty parent container, which is where I added the draggable and hotspot components, since the rotation comes out wrong. I made an empty parent in order to more easily match the rotation of the track and the draggable, as per the first-person primer tutorial. How would you suggest I approach this? Thank you.

  • edited February 2022

    The Collider needs to go on the root Draggable object. If you use the same mesh as the wheel for it and it's the wrong rotation, create a new mesh especially for it.

    To avoid any rotation issues, the Hinge Track and the Draggable should have the same Position and Rotation values in Edit mode.

    If that causes the mesh to appear incorrect, you can either move it to a child object and rotate that child to suit (as is the case in the tutorial), or rotate the mesh in 3D modelling software.

  • I think using a mesh collider instead of a sphere collider does make it a bit smoother, but the 'rewind' issue still happens: https://imgur.com/3axw4pj

  • edited February 2022

    I'll need to see things on my end at this point. If you can create a .unitypackage file of the scene and the assets involved e.g. the collider's mesh, PM it to me and I'll take a look.

    Edit: Never mind - I've recreated the issue. Thanks for the details - I will look into this.

  • edited February 2022

    To clarify: I've recreated the issue when the "Movement input" property is set to "Cursor Position".

    I don't have issues when this is instead set to "Drag Vector", which may be the better option for this kind of scenario. It is necessary to play with the Dragable's "Simulated mass" value, however.

    If you're still getting an issue with this mode, I would need you to PM me a demonstration package after all.

  • You're right, changing it to 'drag vector' and dropping the mass to 0.01 makes it work. Thank you very much.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.