I’m trying to attach the HingeJoint2D of a game object to another game object’s Rigidbody2D at runtime. However, I get the following error message:
error CS1061: Type UnityEngine.GameObject' does not contain a definition for hingeJoint2D’ and no extension method hingeJoint2D' of type UnityEngine.GameObject’ could be found (are you missing a using directive or an assembly reference?)
The prefab I’m instantiating clearly has a 2d HingeJoint attached, all other physics components are 2d as well. How can I access that component from script?