x


Simple steering wheel rotation in a car

I'm semi-new to the whole Unity3D package, and I was wondering how I would attach a separate mesh (the steering wheel) to a physical body (the car that has physics) while keeping rotation values all nice and dandy, and then adding "Input.GetAxis("Horizontal")" on top of it all so that I end up with a steering wheel that is inside a car with physics that rotates according to user input - I'm currently using a Fixed Joint that does not allow me to do anything but to attach the steering wheel to the car - Thanks for any help.

more ▼

asked Apr 16 '11 at 03:46 PM

Majatek gravatar image

Majatek
13 3 3 7

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Make a empty the parent of the car mesh. This will have the rigidbody to add physics. Then make the car mesh a parent of the steering wheel. Then place the steering wheel where you want it, and add your rotation script to it. The steering wheel should now rotate around its own pivot point, and remain inside the car. Or you can put the steering wheel just inside the empty, and not in the mesh for organization.

I hope this helps

more ▼

answered Apr 16 '11 at 04:18 PM

Meater6 gravatar image

Meater6
1.3k 10 14 27

Thanks! I didn't realize that parent objects are at the start of a resource tree, with it's children listed below. :P

Apr 16 '11 at 05:13 PM Majatek
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1335
x424
x63
x48

asked: Apr 16 '11 at 03:46 PM

Seen: 2218 times

Last Updated: Apr 16 '11 at 03:46 PM