I have a wheelJoint2D component attached to an object and I want to be able to control the motor speed with a script. I tried to access the component using gameObject.GetComponent(WheelJoint2D) which is ok but I can’t seem to be able to access motor speed. I’ve tried variants of the following gameObject.GetComponent(WheelJoint2D).jointSpeed = speed; but I am not able to access the variable.
I’m sure that I’ve misunderstood something basic, I just don’t know what.