How can I make my mouse epicenter bigger?
Dell7730
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
-
tatiang Posts: 11,949
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
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
I want an actor to trigger when it's within 100 pixels of my mouse circumference
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
How can I state that to have 100 pixels?
Are you using PC or Mac Creator?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
PC
Thank You Very Much! Really appreciate the huge help, thanks!
You're welcome!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User