User Tag List

Results 1 to 7 of 7

Thread: Object getting launched is getting stuck on the mouse cursor and following it

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Aug 2018
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Object getting launched is getting stuck on the mouse cursor and following it

    I'm making a game with a shootable machine gun in it, but when I use "launch object" to launch a bullet in the direction of the crosshair (the crosshair is always at mouseX and mouseY), the bullets get stuck and they clump up. The bullets also follow the crosshair like a guided missile and don't go in a straight line. I want to have the bullets act like bullets and go in a straight line and go through the crosshair.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,344
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    So what do you need help with exactly? If you want the bullets to always follow the crosshair, don't you then want them to clump up around it? What do you want otherwise?

  3. #3
    Clicker Fusion 2.5 (Steam)

    Join Date
    Aug 2018
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't want the bullets to follow the crosshair. I want them to act like bullets. I need help to get them to stop following the cursor and clumping around it.

  4. #4
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    166
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by netha View Post
    I'm making a game with a shootable machine gun in it, but when I use "launch object" to launch a bullet in the direction of the crosshair (the crosshair is always at mouseX and mouseY), the bullets get stuck and they clump up. The bullets also follow the crosshair like a guided missile and don't go in a straight line. I want to have the bullets act like bullets and go in a straight line and go through the crosshair.
    Without seeing your code I'm taking a guess here and you've got them always looking at mouseX/mouseY - instead of that, you could make it so when the bullet is created the bullet's alterable values A/B are set to mouseX and mouseY and they look at those values instead. Hope that makes sense!

  5. #5
    Clicker Fusion 2.5 (Steam)

    Join Date
    Aug 2018
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're correct, my code has the bullet always facing the crosshair. I made the code make the bullets' A and B set to Mouse X and Y, but I don't know how to make it launch in the direction of X and Y.

  6. #6
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    166
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    It takes a little bit of vector math - but this is how you get the missile to always look in a certain direction (If you're using the built in movements)
    missile_angle.jpg

    VAngle finds the angle of a vector (in this case, two points). This gives a direction in degrees, but since there are 360 degrees and only 32 directions, you have to divide it by 320/32, which is 11.25


    Here's the sample code if this makes it easier
    missile_test.mfa

  7. #7
    Clicker Fusion 2.5 (Steam)

    Join Date
    Nov 2016
    Posts
    40
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

Similar Threads

  1. Replies: 6
    Last Post: 9th October 2017, 04:25 AM
  2. Mouse Control and mouse cursor
    By DEKE15 in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 4th December 2016, 10:38 PM
  3. Create a object from the mouse cursor
    By Bluemilkao in forum Fusion 2.5
    Replies: 6
    Last Post: 23rd October 2015, 08:17 AM
  4. user error or bug? launching object at mouse cursor
    By jinchoung in forum Fusion 2.5
    Replies: 4
    Last Post: 15th July 2014, 06:13 PM
  5. How to set object angle so that it is always facing the mouse cursor
    By AnD4D in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 17th May 2012, 09:39 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
  •