Set angle to mouse.x, mouse.y

Bugs will be moved here once resolved.

Post » Sun Nov 13, 2011 2:41 am

I am having a very strange problem.
I have a turret which has one event for aiming: set angle towards position mouse.X, mouse.Y.

This works well. Most of the time. Sometime however, I get a strange glitch where it SORT of points towards the mouse, but not quite. Obviously this is a game breaking bug but it is not my code as there is only one event for aiming. Just to make sure, I made another object (the yellow thing) with two events: one to set position to the tank, and another to set angle towards (mouse.x, mouse.y). Same problem.



Interesting...
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Nov 13, 2011 5:00 am

Are you sure you're not slightly scaling or parallaxing any layers? If so remember to pass the layer to the expression (e.g. Mouse.X("Background")) to get the mouse position for that layer.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Sun Nov 13, 2011 5:10 am

Ahhhhhh...
I am scaling a layer, indeed. Thank you.

EDIT: Oops! It seems that I have uncovered a real bug! Adding these properties to my mouse expressions means I get nothing but a grey screen at runtime.sqiddster2011-11-13 05:16:16
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests