Bullet behavior: Angle only sets if speed is greater than 0

Bugs will be moved here once resolved.

Post » Sat Sep 05, 2015 8:48 am

Problem Description
I found that the Set angle of motion action only sets the angle for the bullet behavior if the speed is greater than 0. I'm not sure that this is indeed a bug, however I found no information about this in the manual and I couldn't figure out till now what is causing this issue.
If you set a speed first for the object with the behavior and try to change the angle of motion only after that, it works fine. I think this should either be fixed (to be able to set the angle at 0 speed) or documented to avoid confusing other developers. It also concerns the Custom Movement behavior.

Attach a Capx
https://dl.dropboxusercontent.com/u/166 ... angle.capx

Description of Capx
In the capx there are 2 sprites with 4 instance variables each and a bullet behavior (speed set to 0). I set the start and destination point coordinates at the beginning of the layout into these variables, then I use the angle() expression to calculate the angle for the bullet behavior using the data from the variables. The "Sprite" object gets the angle first and then I set the speed to 100, which results in a movement at angle 0. However he "Sprite1" object gets the speed set first and then the angle set. This object moves in the correct angle.

Steps to Reproduce Bug
  • Create and object with 4 instance variables (for starter and destionation coordinates) and a bullet behavior (speed set to 0).
  • In the event sheet, set the angle of motion for the bullet behavior using the angle() expression with the 4 variables.
  • In the event sheet, set the speed for the bullet behavior to a non-zero value.

Observed Result
The behavior ignores the angle set and starts moving in angle 0 (or -180).

Expected Result
The behavior should be able to set the angle of motion even at speed 0.

Affected Browsers
  • Chromium (Opera): (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
Windows 10 with latest updates

Construct 2 Version ID
r202.2
B
128
S
33
G
17
Posts: 1,551
Reputation: 20,488

Post » Sat Sep 05, 2015 10:38 am

"The bullet's angle of motion is based on it's x and y velocity. If a bullet isn't moving then what is it's angle of motion? "

So when the bullet isn't moving, it's angle of motion = 0 and it's angle gets set to 0.

(i made the same mistake a couple of years ago ;) )
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Sat Sep 05, 2015 12:39 pm

@RamPackWobble Thank you for clearing that up for me. But I still believe, it should be in the manual.
B
128
S
33
G
17
Posts: 1,551
Reputation: 20,488

Post » Tue Sep 08, 2015 3:52 pm

Closing as by design.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests