I managed to make my character turn but now I wanted to know how to make him go in the direction he is, I can’t
NOTE: the character is a ship
I managed to make my character turn but now I wanted to know how to make him go in the direction he is, I can’t
NOTE: the character is a ship
Can you screen snip the events to give an idea of how you are rotating the ship?
OP already has the turning sorted (and it’s a ship, not a player character).
The solution to move will depend on whether the ship is being rotated by setting the angle, GDevelop forces or physics forces.
using A and D, I said ship but it’s a ship
It’s not from top to bottom, it goes all over the screen
physical force that I put to rotate, using the A and D keys
Can you screen shot the events that rotate the ship object? I’m not sure if you are referring to GDevelop forces or applying a Physics torque.
When you apply the force, make sure you use the Physics2::MassCenter functions:
Also, if the mass is more than 1, you may want to increase the force (Length) applied.
Now it is going in the direction it is turning but it is not going forward but to the side, I will send an image to see what my ship looks like, I wanted it to go forward in the direction it is pointing
If the image used for the player sprite is not facing to the right, then you’ll have to adjust the angle the force is applied at by 90 degrees:
It just got faster, but it still has the same problem
The speed is determined by the length value. Reduce it to slow it down.
Can you screen shot the player object in the sprite editor, and the events that move it again?
The problem is not the speed, the problem is that it gives a thrust in the direction of the side of the ship and not in front.
It sounds like the sprite is not facing to the right. If you edit the sprite so that the ship faces East then it should match the rotation angle of the object during the game.
You could also adjust the angle as @MrMen suggested, although I feel that is less straightforward than having all your sprites match the Angle()
How do I change it? To get the right spin?
Just edit the graphic of the ship. We’re guessing that you drew it facing either up or down… rotate it so that it faces to the right.