How can I make my mouse epicenter bigger?

Dell7730Dell7730 Member, PRO Posts: 388

I want an Actor to be able to collide with my mouse but outside a set circumference of say about 100 pixels, not just the main tiny contact point of its X and Y location.

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer

    The Mac version of Creator has a Numeric Expression as part of the rule condition but I'm not sure if the PC version does. If not, you'll need to create an integer attribute (e.g. self.Hundred) and give it a value of 100. Then set up your rule to say If attribute self.Hundred ≥ magnitude( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y ) then _______.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    How does an actor collide with your mouse? Do you mean that you want the actor's rules to trigger when the mouse position is within 100 pixels of the actor? If so, you can use the magnitude() function which returns the distance between two points.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Dell7730Dell7730 Member, PRO Posts: 388
    edited March 2015

    @tatiang said:
    How does an actor collide with your mouse? Do you mean that you want the actor's rules to trigger when the mouse position is within 100 pixels of the actor? If so, you can use the magnitude() function which returns the distance between two points.

    I want an actor to trigger when it's within 100 pixels of my mouse circumference

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    magnitude( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y ) will give you the distance from the actor's center to the mouse position.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Dell7730Dell7730 Member, PRO Posts: 388

    @tatiang said:
    magnitude( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y ) will give you the distance from the actor's center to the mouse position.

    How can I state that to have 100 pixels?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Are you using PC or Mac Creator?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Dell7730Dell7730 Member, PRO Posts: 388

    @tatiang said:
    Are you using PC or Mac Creator?

    PC

  • Dell7730Dell7730 Member, PRO Posts: 388

    Thank You Very Much! Really appreciate the huge help, thanks!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You're welcome!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.