mouse direction
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: mouse direction
You compare mouse.x with player.x, but they could both be using a different scale. Especially if you have a camera lib that changes the coordinate system, then player.x could be somewhere very high, say 2000 pixels, while the mouse coordinates are always somewhere inbetween 0 and, for example, 800. Clicking on coordinate 800 will make the game think you're clicking on the left side, not right. You'll need to convert the player's coordinates to the same values the mouse is using before you can compare them.
Who is online
Users browsing this forum: Bing [Bot] and 8 guests