I could need a little help with physics objects and rotation
I have a ship and bullets as physics objects, the ship has a point(called thruster(sic)) - where the bullets should be spawned and fired - with applied forces.
When I rotate the ship, the distance from the point/spawn-coordinates to the ship seems to differ with the angle.
So when I fire a bullets upwards, the bullet collides a little bit with the ship,
but when i shoot downwards, the bullet spawns a couple of pixels away.
Maybe i mixing up the angles somehow, I feel I need some input here to get my head straight help would be much appreciated
Short video showing the spawning and then the applied force to the bullet:
Where is the origin of your BulletObj? If it’s not already, try moving it to the centre of the bullet image/object.
This may also fix the issue of the bullet not appearing in the slot - the rotation will be around the origin, and if that’s not centred, then it will look a bit lopsided/funny.
Keep in mind 0 degrees for rotations starts on the right. If you want to do correct rotation for your object, you want the “slot” for the bullet to start facing to the right. You can find more about this here: Basic game making concepts: What you need to know to start with GDevelop [GDevelop wiki]
And the Tank Shooter tutorial also goes through similar concepts: Tank shooter - Beginner tutorial [GDevelop wiki]
This is what I missed!
Now it works perfectly