User Tag List

Results 1 to 10 of 10

Thread: Cant get inbuilt detector to work

  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,188
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Question Cant get inbuilt detector to work

    I have done this sort of thing before, but now for some reason I can't get it to work and can't find what I am doing wrong. Could someone help?

    I am trying to create a "detector" in an object that is smaller than the visible object so I save the animation of the object, then change to the detector animation and check for "collision" and then restore things. But for some reason the collision is still the full object and not the smaller space in the detector animation? I am not even restoring animation frame or anything, just the bare basics.
    Attached files Attached files

  2. #2
    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,188
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I simplified the example even more
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,341
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    You have to remember the bug/feature in the way CF2.5's collision detection system works.
    Let's say you have this condition:

    ObjectA is overlapping ObjectB

    When checking for a collision, CF2.5 will use the current position, animation, frame, etc of ObjectA (the one on the left).
    However, it will use the position, animation, frame, etc of ObjectB (the one on the right) as it was at the start of the event loop (before any events moved it or changed its animation - so basically, where it was at the end of the last frame).

    This applies even if you're testing for a collision with the mouse cursor.
    You obviously can't say:

    ObjectA is overlapping MouseCursor

    ...because there's no such object as "MouseCursor" - unless you create your own "MouseCursorDetector" - an invisible 1x1 pixel active that you always set to the position of the mouse cursor.

    Then you can say:

    ObjectA is overlapping MouseCursorDetector

    ...but bear in mind that the position of the mouse cursor will then lag one frame behind, for the reason already given.

    The only perfect solution is destroy the MouseCursorDetector and create a new one every frame, before testing for a collision.

  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,188
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    You have to remember the bug/feature in the way CF2.5's collision detection system works.
    Let's say you have this condition:

    ObjectA is overlapping ObjectB

    When checking for a collision, CF2.5 will use the current position, animation, frame, etc of ObjectA (the one on the left).
    However, it will use the position, animation, frame, etc of ObjectB (the one on the right) as it was at the start of the event loop (before any events moved it or changed its animation - so basically, where it was at the end of the last frame).

    This applies even if you're testing for a collision with the mouse cursor.
    You obviously can't say:

    ObjectA is overlapping MouseCursor

    ...because there's no such object as "MouseCursor" - unless you create your own "MouseCursorDetector" - an invisible 1x1 pixel active that you always set to the position of the mouse cursor.

    Then you can say:

    ObjectA is overlapping MouseCursorDetector

    ...but bear in mind that the position of the mouse cursor will then lag one frame behind, for the reason already given.

    The only perfect solution is destroy the MouseCursorDetector and create a new one every frame, before testing for a collision.
    Hmm, but I am positive I have done this sort of thing before so it must be possible somehow?
    Inbuilt detectors is a thing? I am sure there is a tutorial on it somewhere also, but can't remember where it is

    I changed the example to not use mouse cursor but just an active that is laying over the object
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    962
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    If you swap the order of the objects in event #2 then your example should work. It's like MuddyMole says; The first object in the overlap condition uses its newly updated animation frame, but the second object doesn't(in your case the "Active 2" doesn't have an updated animation frame or position to keep track of anyways so it's technically fine in this particular situation!).

  6. #6
    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,188
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chrilley View Post
    If you swap the order of the objects in event #2 then your example should work. It's like MuddyMole says; The first object in the overlap condition uses its newly updated animation frame, but the second object doesn't(in your case the "Active 2" doesn't have an updated animation frame or position to keep track of anyways so it's technically fine in this particular situation!).
    Ah thanks that works! I will probably never totally get the hang of the logic behind these overlap events.. :S

  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,188
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    The problem now though is that the object is supposed to animate also, but I can't seem to get that to work now :@..

    Should not a restore animation work?

    Again I am positive I have done this in the past so it should work somehow
    Attached files Attached files

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    962
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    You're almost there. Now you need to;
    - Save and load the animation frame(use an Alterable value)
    - Check the "Do not reset current frame duration when animation is modified" property in the Active Object's Properties window.

    Attached a quick-fix. Turns out you had already made the custom alterable value, so I borrowed it! If you want to save animation as well then it is the exact same method but with animation # instead of frame #.
    Attached files Attached files

  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,188
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by chrilley View Post
    You're almost there. Now you need to;
    - Save and load the animation frame(use an Alterable value)
    - Check the "Do not reset current frame duration when animation is modified" property in the Active Object's Properties window.

    Attached a quick-fix. Turns out you had already made the custom alterable value, so I borrowed it! If you want to save animation as well then it is the exact same method but with animation # instead of frame #.
    Ah nice thank you

    Why is that checkmark not default if it breaks things if it is not checked?

    Saw I made a almost identical tread like 7 years ago. Have not learned a thing haha.. :P Konidias shared a really neat way to do collision detection in that thread based on y x cordinates of action point: https://community.clickteam.com/threads/80302-Built-in-collision-detection

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    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)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    962
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    At first glance it's a strange property(the name is ridiculously long too :P) I cannot remember for sure but I think Restore Animation Frame had a late discovered a bug that we all had been using as a feature.

    Clickteam made changes to it and also left the possibility to restore animation frames the old way through that checkbox. I think it is off by default because technically this is not how it was meant to work? Clickteam would have to correct me on that though!

Similar Threads

  1. Can someone explain this? (Inbuilt detection)
    By Outcast in forum Fusion 2.5
    Replies: 5
    Last Post: 10th April 2014, 05:10 PM
  2. Do inbuilt foreach not work in flash?
    By Outcast in forum Flash Export Module 2.5
    Replies: 10
    Last Post: 1st February 2014, 05:34 PM
  3. Easy Detector
    By Jarzka in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 2nd May 2007, 04:38 PM
  4. Two loops using one detector?
    By Isbeorn in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th September 2006, 04:59 PM
  5. Platform Movement with inbuilt detector
    By Bernie in forum File Archive
    Replies: 9
    Last Post: 23rd July 2006, 02:27 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
  •