I have a simple world set up with an object and a ground plane.
Everything works. If I enable gravity the object falls and bounces off the ground plane.
I want to make sort of a little spaceship that I can fly around using the arrow keys. I have this all set up. What I need to figure out is which property to use to make the body move.
I created a new b2Body using World.CreateBody. I saved this body in a variable and am using this as my target.
I tried using SetLinearVelocity(). But this seems to produce no result.
_ship.SetLinearVelocity( new b2Vec2( 0, 2 ) );
Looking at this now. I'm realizing the number 2 should probably be a lot smaller if the units are meters.
Everything works. If I enable gravity the object falls and bounces off the ground plane.
I want to make sort of a little spaceship that I can fly around using the arrow keys. I have this all set up. What I need to figure out is which property to use to make the body move.
I created a new b2Body using World.CreateBody. I saved this body in a variable and am using this as my target.
I tried using SetLinearVelocity(). But this seems to produce no result.
_ship.SetLinearVelocity( new b2Vec2( 0, 2 ) );
Looking at this now. I'm realizing the number 2 should probably be a lot smaller if the units are meters.