Sprite Angle Bug? R145

Bugs will be moved here once resolved.

Post » Thu Sep 26, 2013 1:00 pm

Link to .capx file (required!):

Angle bug


Steps to reproduce:
1. Set the sprite angle in the "object type properties" bar(other than 0)
2. Use the expression "angle" to get the object current angle
3. If you set the angle via the "Set angle" action event, the error doesn't occur.

Observed result:
You will get a value like this(90.00002104591) if you set 90 for the angle.

Expected result:
The integer number

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Wndows 7& service pack:

Construct 2 145:
cesisco2013-09-26 13:02:40
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Thu Sep 26, 2013 1:57 pm

Closing as not a bug. Internally angles are stored as radians, and there is a small error introduced by converting degrees to radians and back again. Work around it by only showing a few digits of precision (or just round the angle).
Scirra Founder
B
400
S
237
G
89
Posts: 24,550
Reputation: 195,537

Post » Thu Sep 26, 2013 3:04 pm

Ok, i'm already doing that, but i thought it was a bug.
Thanks.
B
36
S
11
G
9
Posts: 399
Reputation: 10,283


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests