error in 2d game developement! .please help me out

Updated on April 4, 2017 in [A] 2D
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on April 3, 2017

All you need is to replace “Rigidbody2D.velocity.y = speed;” to GetComponent.Rigidbody2D().velocity.y = speed; (Add “>” before and after Rigidbody2D)

i dont know were to add these “>” braces. but when i don’t add these braces i get an error as “rigidbody2D is not a member of function(system.type): unityengine.component.

please give me the correct code.!

  • Liked by
Reply
1 on April 3, 2017
GetComponent<Rigidbody2D> ().velocity.y
on April 4, 2017

thanks a lot!

Show more replies
  • Liked by
Reply
Cancel
0 on April 3, 2017

You said exactly where you had to place them yourself already: Add “>” before and after Rigidbody2D

  • Liked by
Reply
Cancel
0 on April 4, 2017

Thanks a lot!

  • Liked by
Reply
Cancel