Quantcast
Channel: Answers by "Graham-Dunnett"
Viewing all articles
Browse latest Browse all 959

Answer by Graham Dunnett

$
0
0
`RigidBody.mass` is not a Component. `RigidBody` is. So you need to do: var myRigidBody : RigidBody = GetComponent(Rigidbody); However, that's totally unnecessary. All game objects have a member called `rigidbody`, so you can just do: function Start () { DebugLog(rigidbody.mass); } Note that the Component is called `RigidBody` (with an upper-case R and B) and the member is called `rigidbody`, all lower case. Finally, in your code you clearly want to access the `mass` member. You should do something with it. In the code I posted I just printed it to the screen.

Viewing all articles
Browse latest Browse all 959

Trending Articles



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