User Tag List

Results 1 to 2 of 2

Thread: How to make a physic object follow the mouse and collide properly?

  1. #1
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)
    SergioAndre's Avatar
    Join Date
    Mar 2009
    Location
    Argentina
    Posts
    98
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question How to make a physic object follow the mouse and collide properly?

    Hi all!

    I'm trying to make an object (with physics) follow the mouse, like the Mallet of an airhockey game. I tried but it is not like I want, the collisions are not accurate and sometimes the Mallet passes over the Puck without colliding.

    It seems simple to do but so far I could not make it work properly.



    I am using the "physics - engine" object and the "Physics - Bouncing ball movement" for the puck.

    My idea is to make an air hockey game using physics, so that the movement of the Puck is more natural and accurate.


    I appreciate any help.

  2. #2
    No Products Registered

    Join Date
    Feb 2015
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i am guessing that when the mouse feeds its coordinates to the pc at the mouse-driver level, it can jump from 1 position to the next without all the numbers in between, which is why it moves so fast. so if you move mouse fast, and it goes from 60 to 200 in ONE step, and the puck is at 100, it misses.
    i am only starting out, but i guess you would have to have self-coded "mallet_x" and "mallet_y" variables that change BASED on how far the mouse has moved (ie comparing "mouse_position_now" with "mouse_position_before", however long before is!) , so that a slow actual mouse movement will change mallet_x and mallet_y by +-1 pixel (?) and a fast movement (ie 60 to 200) will move it by +-5 pixels (or whatever maximum number doesn't skip over (the middle of?) the puck)
    so there is a bi more to calculate (especially to see where the mouse was, where is it now)
    hope that helps

Similar Threads

  1. Replies: 2
    Last Post: 9th May 2014, 06:07 PM
  2. Anyway to make the 3d mesh object follow the frame?
    By path in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 13th August 2013, 02:06 AM
  3. Make an active object follow the screen?
    By Shizzle in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 5th September 2010, 04:39 PM
  4. help (make object follow the cursor)
    By grayhuskie53 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 12th March 2007, 08:25 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
  •