# Avatar hand controlled Steering Wheel

Hi Everybody ,
I need to develop a avatar hand controlled Car steering wheel .Some one could you help me ?

rig the avatar in the car interior using a 3d tool. then make an anim track that runs the steering wheel and avatar arms from like -120 deg to +120. Some 3d tools have ik to help keep hands gripping wheel. then in unity you just run anim to desired pos using script. you can also do ik at runtime in unity i think but not sure how, i need to research that. having the anim pre baked in external 3d tool is computationally cheaper tho.

Hi SiliconDroid
Thank you for your valuable thoughts.
I need this diving experience on the oculus avatar hand controller .I have been done most of the part ,but the problem is still precesting on the physics .Moreover can’t rotate an object on x axiz using Hinge joint can you share any idea or inspector value of a Hinge joint

i wouldnt use physics in the car interior. i would just use a pre baked avatar animation and scrub that animation around in script. i would do that because i have tight processor budget devving for mobile. if youre devving for pc then you might use physics although maybe problems bevause interior will be within main car collider.

once you make good anim in 3d tool its easy and cheap to scrub around that anim in script. and perfectly doable in 3d tool as single anim track because that anim is one dimensional, ie wheel angle is main driving variable.

Yes its a kind of devving our User ,I need a exact feel of car driving without using a physical steering wheel rather Oculus Touch control .Oculus touch control interact only a Grabable object ,So How to lock Grabable objects Position x,y,z axis

When user is grabbing wheel you need to make spatial position be closest point on the circle that is the wheel.

To do this use arc tangent2 function to analyse X and Y spatial components of touch controller position in steering wheels local space, where centre of wheel is X=0, Y=0.

This gives an angle. Then slerp quickly to point on circle.

So get the controllers transform and apply InverseTransformPoint to get its position in the wheel transform space.

Take these wheelspace x,y coords and do Mathf.Atan2(x, y).

This gives the angle in radians on the wheel closest to controller.

Then synthesize a “locked” position on the wheel:

Point on circle:
X component = circle centre X + sin(angle) * radius
Y component = circle centre Y + cos(angle) * radius

For the controllers rotation you could use as is, or perhaps derive a locked angle to keep the displayed controller always tangential to the wheel.

EDIT: simpler soln: take Vector3 position of controller in wheelspace, zero its z value, normalize it and multiply it by wheel radius. This gives point on wheel in wheelspace.

Hi have you did that correctly,

I am also trying to do something like that in which using my oculus hand I can grab the steering wheel and can rotate the wheel using my hand anchor position.
you can also contact me at prashantghatelwal@gmail.com