Answer the question
In order to leave comments, you need to log in
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 .
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question