# SOLVED Changing a bullets angle of motion

Get help using Construct 2

### » Mon Jul 16, 2012 5:18 pm

It should be simple, I'm sure it IS simple, but I'm having an off day.

I have a bullet that I want to travel at 45 degrees on layout 2. I have a fade effect when transitioning from layout 1 to layout 2, so I only want the bullet to start moving once the fade is complete. To that end, I set the bullet's speed in its properties to 0, then added a 'Fade out finished' event for layout 2, with the actions 'Set bullet angle of motion to 45 degrees' and 'set bullet speed to 150'. Everything works as intended, except for the angle - the bullet just sets off at 0 degrees.

What seems odd to me, is if I remove the 'set bullet speed' action from the event list, and just put a figure for the speed in the bullet's properties, then it moves at the intended 45 degree angle.

So how can I get this working?

edit: some further notes:

If I swap 'set bullet angle of motion' for 'set angle' and turn on the option to link object angle with angle of motion in the bullet's properties, then the bullet moves at 45 degrees, HOWEVER I do not want for the sprite to rotate 45 degrees, but to stay upright and only move at 45 degrees.

edit2:

SOLVED

In the bullet's object properties set the desired speed.

In the event list:

System -> on start of layout -> set bullet disabled
fader -> on fade out finished -> set bullet angle to 45 degrees.
BlueSkies2012-07-16 17:39:41
B
18
S
4
G
4
Posts: 68
Reputation: 3,127

### » Mon Jul 16, 2012 11:14 pm

[QUOTE=BlueSkies]'Set bullet angle of motion to 45 degrees' and 'set bullet speed to 150'.
[/QUOTE]
When the speed is 0, the angle of motion = 0 so you have to set the speed before setting the angle of motion.
B
53
S
28
G
18
Posts: 1,520
Reputation: 24,905

### » Sun Dec 30, 2012 4:31 pm

[QUOTE=BlueSkies]When the speed is 0, the angle of motion = 0 so you have to set the speed before setting the angle of motion. [/QUOTE]
Sorry for necroing this thread but I just wanted to bump it up to request this important detail to be included in the manual at
Bullet Behavior

Lost a good hour testing and looking at the manual and trying stuff before trying finding it in the forums
B
18
S
4
G
4
Posts: 70
Reputation: 3,871

### » Wed Apr 10, 2013 7:13 am

Bump (along with an apology for resurrecting) for same request. New to Construct, but spent DAYS trying to figure this out. Was getting unpredictable random results with bullet angle of motion before learning to set the speed first. Would have been awesome if this was in the manual.
B
5
S
2
G
3
Posts: 1
Reputation: 2,084

### » Wed Jul 24, 2013 6:25 am

Had the same issue. But it seems only angles between 0 and 90 are affected.

I spawned a sprite which is originally used for the HUD display so its speed was set to 0 by default. I used Set angle of Motion 90 (also tried 45 and 0) + Set Bullet Speed. But it always moved to the right (angle = 0). When I set the angle to 180 it moved left! So this could be a little bug when it only affects 0 to 90 degrees?

Fortunately the search brought up this topic rather quickly.
B
47
S
14
G
5
Posts: 634
Reputation: 8,005

### » Wed Jul 24, 2013 7:50 am

It seems to happen with sprites which have a default Bullet speed as well.
I spawned a Laser Sprite with default bullet speed of 400 with angle 90 but it moved to the right (angle 0).

Spawn SPRITE on Layer X
Set Bullet angle of motion to <0-90> degrees

The laser default angle is 180 to make it look like coming from above.
When I add "Set Bullet speed to Y" it still moves to the right.

/Edit: I had to disable Bullet.SetAngle to make this one work. :)Bl4ckSh33p2013-07-24 07:59:25
B
47
S
14
G
5
Posts: 634
Reputation: 8,005