c# - Convert Code from Unity 4 To Unity 5 -


i new installed unity 5. have problem in code.

if (transform.parent.rigidbody) parentmagnitude = transform.parent.rigidbody.velocity.magnitude * 0.05f;

you can't access rigidbody old shorthand code.

    rigidbody rb = transform.parent.getcomponent<rigidbody>();     if(rb != null) {         parentmagnitude = rb.velocity.magnitude * 0.05f;     } 

Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -