I
I
INROOM2015-04-04 10:29:33
Programming
INROOM, 2015-04-04 10:29:33

Error CS0120 on c# in unity, what's wrong?

I'm just learning to program in c# and immediately ran into a problem.
It seems like I'm doing everything right, but it doesn't want to work 1db86f92cf844def8e2f98dfb213c060.png.4460a3fde0a3415b9348a300f8c87f05.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
localghost, 2015-04-04
@INROOM

You don't have an object of class RigidBody2D yet. There is only the class itself, read: template, drawing. You are trying to find out the speed of a car from its blueprint. As the error tells you, this can only be done with static members of the class (that is, common to all its objects. Let's say the number of wheels, if this is a class of ordinary cars :)), and velocity, which is logical, is a non-static member.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question