User Tag List

Results 1 to 6 of 6

Thread: A very random issue...

  1. #1
    No Products Registered

    Join Date
    Jun 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question A very random issue...

    I'm trying to get a character to shoot a bullet at the position that I click. What I tried was to make a "target" object that is mouse controlled, and when the user clicks, it shoots a bullet at the location of the target. Problem is, when I assign it to a mouse click, it seems to just not register the click at all. It will fire if I assign the key to a keyboard key, but not with any mouse button.

    I'm assuming it has something to do with the mouse controlled object, I just don't know what.

    Any ideas?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using a mouse controlled movement disables the standard click conditions. Instead, you need to use the Player Object's "read joystick state" condition and check for Fire 1 being pressed.

  3. #3
    No Products Registered

    Join Date
    Jun 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by Jaffob View Post
    Using a mouse controlled movement disables the standard click conditions. Instead, you need to use the Player Object's "read joystick state" condition and check for Fire 1 being pressed.

    Hah, that did it. Thanks!

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An alternative is to avoid the Mouse movement and use the Set X Position to xmouse and Set Y Position to ymouse actions. This will give you more control without disabling the mouse controls.

  5. #5
    No Products Registered

    Join Date
    Jun 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha thanks man. That makes things way easier. It actually solved another problem too. I appreciate it!

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem. A system like this lets you play with the formula a bit.

    The min(x,y) function returns the smaller of two numbers, while max(x,y) returns the greater. If you set the position to max(32,xmouse) the object will move to whichever is larger, which stops it from moving left of 32. Coupling this with min() gives you min(Left Boundary,max(xmouse, Right Boundary)) where the boundaries are pixel values. You can combine this with an easing formula (my preference being (9*X+XMouse)/10.0 ) and get a smooth movement.

    The final formula, then, would be:
    Always:
    Set X Position of Active to: (9*X("Active")+min(Left Boundary,max(xmouse, Right Boundary)))/10.0 )
    Set Y Position of Active to: (9*Y("Active")+min(Top Boundary,max(ymouse, Bottom Boundary)))/10.0 )

    or, to dynamically change the boundaries when the frame moves,

    Always:
    Set X Position of Active to: (9*X("Active")+min(X Left Frame,max(xmouse, X Right Frame)))/10.0 )
    Set Y Position of Active to: (9*Y("Active")+min(Y Top Frame,max(ymouse, Y Bottom Frame)))/10.0 )

Similar Threads

  1. Random Active Spawn in Random Location in Frame
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2016, 03:33 AM
  2. String Tokenizer and Random Pool issue
    By ratty in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th March 2013, 09:59 PM
  3. Random Animation Issue
    By xhedgehogx in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 25th September 2012, 02:17 AM
  4. Random Speed + Ypos at random times
    By Keehan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th May 2011, 05:25 PM
  5. Objects in multimediafusion 2 random spawn issue
    By Krippa in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 15th March 2010, 01:55 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
  •