User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Possible to create recoil with mouse pointer?

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Possible to create recoil with mouse pointer?

    I was trying to no avail to create a recoil effect of the mouse pointer when you shoot your gun.

    I have a crosshair that is at the X and Y positions of the mouse.

    I tried to do a condition when i press button the gun fires and set -10 to crosshairs position for example. But that did not work.

    Then i tought that maybe its because the crosshair is set to ALLWAYS be at X and Y of the mouse. So i made a counter instead set at 0 and made a condition that when the counter is at 0 the crosshair should be at mouse X and Y and so on.. but i did not get that to work ether.

    Is there any way to do this?

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    Two ways:
    1: Use the mouse object to actually move the mouse
    2: Always set your crosshair's Y to being "MouseY - Global Value Recoil", then fiddle with "Global Value Recoil". Make sure you return it to 0 after a little while though.

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    Thanks but is there any more information on this?

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    Ah i think i got it to work with a recoil value thanks!

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    O no it did not work so well actually because when it has moved far enough at some side it wont go further in that direction.. I guess thats you thought i should return the value to 0 sometimes, but that does not work so well because then the crosshair will jump to some unexpected place all of a sudden?

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    When the player fires, you'd set the crosshair's Y to "MouseY - Global Value Recoil" which would instantly pop the crosshair like a recoil, and then you could just have another condition that checks if the recoil value is greater than zero, and if it is, subtract until it's zero. That would give the effect of the crosshair popping up when firing and then settling back down to the center of the mouse again.

    How much you subtract from the value each loop would determine how fast the crosshair settles back to mouse center.

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    Quote Originally Posted by Konidias
    When the player fires, you'd set the crosshair's Y to "MouseY - Global Value Recoil" which would instantly pop the crosshair like a recoil, and then you could just have another condition that checks if the recoil value is greater than zero, and if it is, subtract until it's zero. That would give the effect of the crosshair popping up when firing and then settling back down to the center of the mouse again.

    How much you subtract from the value each loop would determine how fast the crosshair settles back to mouse center.
    Would it not feel strange when you controll the crosshair after a shoot if it constantly tries to "pull" you in anohter direction?

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    What do you mean "pull" you in another direction? The crosshair should be the only thing moving during the recoil.

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,237
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    Quote Originally Posted by Konidias
    What do you mean "pull" you in another direction? The crosshair should be the only thing moving during the recoil.
    Yes but you said i should have a condition also to return the value to 0 after i have fired. That makes the crosshar slide or pull. It dont stand still after i have fired instead it moves toward the mouse

  10. #10
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Possible to create recoil with mouse pointer?

    Isn't that what a recoil does? One way or another, the mouse cursor is going to be forced away from where you pointed it and then return to the mouse's position. You control how fast that happens, so that it doesn't affect gameplay too much. You might also try disabling player input so they can't move the mouse cursor during the recoil. Then the positioning code won't be dealing with you moving the cursor around during the recoil. (and before you ask, that is for YOU to figure out and design for your game)

Page 1 of 2 1 2 LastLast

Similar Threads

  1. object following mouse pointer?
    By flyingpixel in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 21st September 2015, 09:09 PM
  2. [Bug] Mouse pointer is over <object>
    By Sphax in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 21st February 2014, 04:45 AM
  3. Mouse Pointer & Mouse controlled obejct
    By danjo in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th April 2012, 12:17 AM
  4. Mouse Pointer
    By Crls in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 17th April 2010, 08:18 PM
  5. Mouse pointer help
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th February 2007, 08:53 AM

Posting Permissions

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