[FIXED] Changing the Target Velocity of a Hinge Joint Motor in script

I’m trying to get a Rigidbody to turn itself as it moves around a point by using a hinge joint motor. The only value I need to affect is the Target Velocity. When I initially tried this, I got an error telling me to store hingejoint.motor.targetvelocity as a temporary variable before altering it and reassigning it (getting it and setting it;) however, now that I’ve done that, I get no errors, but the target velocity remains how it was set before runtime. Here’s my code:

using UnityEngine;
using System.Collections;

public class MerryGoRound : MonoBehaviour {

	public GameObject funnel;
	public float turnSpeed = 1f;

	HingeJoint joint;
	JointMotor motor;

	void Start () {
		joint = GetComponent<HingeJoint>();
		motor = joint.motor;
	void FixedUpdate () {
		Vector3 line1 = funnel.transform.position - transform.position;
		Vector3 line2 = (funnel.transform.position + new Vector3(0f, 10f, 0f)) - transform.position;
		Vector3 perp = Vector3.Cross(line1, line2);
		Vector3 wheelForwardVector = transform.forward;

		float tempTargetVelocity = motor.targetVelocity;
		tempTargetVelocity = Vector3.Angle(wheelForwardVector, perp) * turnSpeed;
		motor.targetVelocity = tempTargetVelocity;

This didn’t work for me. I entered the code exactly as shown in the comment to your post, except I’m using motorSpeed instead of targetVelocity. Does that make a difference? I really need to be able to control the movement of the Joint.