Hey everyone I’m new to Gdevelop and coming from Game Maker Studio, My problem is when I shoot an arrow type bullet the Image angle does not face the direction. In Game Maker Studio I would simply type image_angle = direction. any suggestions?
Gdevelop uses “angle” to apply to both the direction of movement and the rotation of an object.
The usual procedure is to change the angle of the object to be whatever the force angle is.
An event for an object called’ arrow’ being fired at 37° will look something like this:
No conditions | Add to arrow a force, angle 37 degrees and length: 200 pixels | Do = arrow.ForceAngle() to angle of arrow
You can add a force using: Add an action>Movement>Add a force (angle)
You can change the object rotation using: Add an action>Angle>Angle
This will give an instant rotation, but you can have a slower rotation if you use the ‘Rotate toward an angle’ action.
You could have a wobbly arrow if you changed the action to something like: Do = arrow.ForceAngle()+Random(30) to angle of arrow
One thing you need to be careful of is that an angle of zero means ‘facing to the right’, so your arrow sprite would need to be horizontal and pointing to the right when you import it into GDevelop in order for it to rotate correctly in the game.