Hi,
i want to build a space ship game in which you rotate your ship by using the mouse and i want to apply a velocity based on the current rotation of the sprite.
First i set a rotation with the following line of code:
gameObject.transform.rotation = Quaternion.Euler(0f, 0f, angleInDegrees);
That works well, but now i have no clue how to apply a ‘force’ to the gameobject in the correct direction.
And i was also wondering why the ‘AddForce’ method does not work with the rigidbody2D, so i want to change it using ‘gameObject.rigidbody2D.velocity’.
Would be nice if you guys could help me out.
thanks
Avoider
I think you're right. Speed is not an issue for me though, as I am not running a realtime app (I'm simply generating thousands of images for use in something else.)
– badgeir