You shouldn't modify this vector:
View attachment 100354
Assign a new vector.
Erel, thanks for your response, but then of create a new vector, how do I set this vector in the body? I was trying put this code bw.Body.LinearVelocity=X2.CreateVec2(1,0) (if this you mean create new vector), but when I run I get an error and the application closes (all this is done in the character class)
Error Logs
x2utils$ResumableSub_MainLoop.resume (java line: 847)
java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
at anywheresoftware.b4a.objects.B2World$B2ContactListener.beginContact(B2World.java:267)
at org.jbox2d.dynamics.contacts.Contact.update(Contact.java:330)
.
.
.
If I create the new vector in the GAME class all works fine, but inside the character class appear the previous error logs....
I was thinking that for any reazon this only can set in the Game class, but cheking the Mario example, I can See this code in all of classes, so Which can be the drawback?