Tracking Mouse Proximity to Object

TosanuTosanu Member, PRO Posts: 388

I am trying to adjust a cannon style game. I have the power bar and aiming angle constrained to touch/mouse position wiith a magnitude and VectorToAngle function, respectively. However, I wish to adjust it that there is a limited field in which it registers these touches, probably about 2-300 pixels around the cannon. Its to prevent a style of play of just tapping where the shot needs to go, creating an Aiming requirement. Is there a simple way to set this up?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited March 2014

    Sounds like you need to use the magnitude function again to find out if magnitude of mouse XY is <300 from Cannon XY.

    I made a quick demo for you attached.

    Darren.

  • TosanuTosanu Member, PRO Posts: 388

    Ah, I see. I was thinking a secondary touch/collision check, but this seems much simpler. It should work well. Thanks a lot for the help!

Sign In or Register to comment.