Rotate a physics object and its points

Hello
I could need a little help with physics objects and rotation :slight_smile:

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 :slight_smile: help would be much appreciated

Short video showing the spawning and then the applied force to the bullet:
https://www.youtube.com/watch?v=x1hjioyumqs

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.

1 Like

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]

1 Like

This is what I missed!
Now it works perfectly
many thanks

1 Like