#How to apply basic 2D forwards momentum?
11 messages · Page 1 of 1 (latest)
Angular Momentum is kind of mass for rotation. Is that what you want?
Or add_torque?
https://godotengine.org/qa/45579/adding-torque-around-a-local-axis
Hey, I have a spaceship that needs to be able to move around the world. Currently the ship can ... do I apply torque around the ship's local axes?
i meant more like an Asteroids-like movement for a CharacterBody2D
i know there's self.rotate() to handle steering, i just don't know how to apply a force to a chosen direction without individually dealing with velocity.x and velocity.y individually
btw the editor tells me there's no apply_torque() or add_torque() in neither RigidBody or CharacterBody
..i figured it out
just invoke a rotation of a Vector2 and apply that to the speed you'll eventually use
so the code i made looks something like
Vector2(torque, 0).rotated(self.rotation)
Torque is in this example https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#using-rigidbody2d
In game development, you often need to know when two objects in the game intersect or come into contact. This is known as collision detection. When a collision is detected, you typically want somet...