There's no velocity field in Rigidbody2D section in the inspector, How?

Hey,

  1. How is it possible that we use Rigidbody2D component.velocity if ther’s no velocity field in the inspector (in the Rigidbody2D component section)?

  2. What’s those <> brackets do?

  3. And just to make sure that I understood - does the click give the ball xPush units / sec and yPush units / sec? (Velocity is distance / time)

Thanks :slight_smile:

Hi Niv,

Thank you for your question. :slight_smile:

  1. velocity is part of the Rigidbody2D class, which we didn’t create. Not all variables appear in the browser.

  2. <> doesn’t “do” anything. There is a special type of methods in C# called generic methods. Their syntax requires <>, in which we tell the computer what type we use here.

  3. You are right. The velocity is WU per second.


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms