Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Unable to AddForce on a game object containing a RigidBody2D and a HingeJoint2D?

$
0
0
I have a game object which contains a HingeJoint2D and a RigidBody2D. I've also attached the following debugging script: void FixedUpdate() { if (Input.GetKey(KeyCode.Space)) { GetComponent().AddForce(Vector2.up * 100f); Debug.Log(GetComponent().velocity); } } I've found that when I have the HingeJoint2D enabled, the script does not add force to the RigidBody2D. However, if I disable the HingeJoint2D, the script adds the force as expected. Why is this?

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>