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.
The behavior ignores the angle set and starts moving in angle 0 (or -180).
The behavior should be able to set the angle of motion even at speed 0.
- Chromium (Opera): (YES)
- FireFox: (YES)
- Internet Explorer: (YES)
Operating System and Service Pack
Windows 10 with latest updates
Construct 2 Version ID