User Tag List

Results 1 to 8 of 8

Thread: How to create object at mouse position?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Sep 2009
    Posts
    356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create object at mouse position?

    How to create object at mouse position?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    It's simple:

    First, you create the object outside of the frame, then set its x position to "Xmouse" and its y position to "Ymouse".

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Sep 2009
    Posts
    356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK then more tricky question:
    How to make object look at mouse position?

    I don't want use any mediate object.

  4. #4
    Clicker

    Fusion 2.5SWF Export Module

    Join Date
    Jun 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To make an object look at the mouse position without any mediate object you would have to use some trigonometry.

    The following Condition / Action:

    Set direction to: (ATan2(Y( "Active" )-YMouse, X( "Active" )-XMouse)*-1+180)/11.25
    (You select direction by using the expression editor, there is a 1+1 button on the bottom right of the of the popup window that you need to click)

    Will find the angle of the line segment between your active and the mouse point. It gives us a value from 0 to 180 both positive and negative. So we multiply that by negative 1 to get rid of the negative side and add 180 to have a value from 0 to 360 ( a circle) Then, since active objects only have 32 directions we divide 360 by 32 to get (11.25). We divide the solution of (Atan2*-1+180) by 11.25 to get numbers in relation from 0 to 32.

    Edit: added an example file to the post.
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Sep 2009
    Posts
    356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Could I use vector movement to more precise angles?

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,308
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GoofyGamer View Post
    To make an object look at the mouse position without any mediate object you would have to use some trigonometry.

    The following Condition / Action:

    Set direction to: (ATan2(Y( "Active" )-YMouse, X( "Active" )-XMouse)*-1+180)/11.25
    (You select direction by using the expression editor, there is a 1+1 button on the bottom right of the of the popup window that you need to click)

    Will find the angle of the line segment between your active and the mouse point. It gives us a value from 0 to 180 both positive and negative. So we multiply that by negative 1 to get rid of the negative side and add 180 to have a value from 0 to 360 ( a circle) Then, since active objects only have 32 directions we divide 360 by 32 to get (11.25). We divide the solution of (Atan2*-1+180) by 11.25 to get numbers in relation from 0 to 32.

    Edit: added an example file to the post.
    Quote Originally Posted by qenio View Post
    Thanks. Could I use vector movement to more precise angles?
    Actually, I believe that you could use scale -> angle draw (or something like that) to get the effect of the object looking at the mouse too, without the animation being limited to MMF2's 8-32 something directions.

  7. #7
    Clicker

    Fusion 2.5SWF Export Module

    Join Date
    Jun 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes you can use vector movement. Though to get more precise angles I would say to rotate the actual object you are using. You would set the angle instead of setting the direction.

    Set Angle : ATan2(Y( "Active" )-YMouse, X( "Active" )-XMouse)*-1+180

    360 degree rotation that will point the object to wherever the mouse is.
    Attached files Attached files

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Sep 2009
    Posts
    356
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for you help.

Similar Threads

  1. starting position of mouse controlled object
    By mbuddha in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th November 2012, 07:33 PM
  2. Can't create more than 9 objects when pressing a keyboard key at mouse position
    By Villmaxie in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd April 2012, 10:00 AM
  3. How to set the position of mouse?
    By Krisse in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th March 2008, 12:30 AM
  4. Create object at same position of object destroyed
    By The Thinker in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 6th November 2006, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •