User Tag List

Page 5 of 6 FirstFirst ... 3 4 5 6 LastLast
Results 41 to 50 of 56

Thread: Issue with horizontal collision with moving platform

  1. #41
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, so I'm still having some problems with these.
    example.jpg

    I'm using the method where I compare positions to determine whether or not I am colliding, and it works great!
    EXCEPT, it only works when there is only one instance of the object the player is colliding with. I realize this is due to the object scoping somehow, because the code only works if the condition is true for "all objects". However, I just can't seem to figure out how to get around it. I tried having a fastloop for each instance of the moving platforms and giving them IDs, and then comparing the ID to the loopindex when testing the positions but this did not work.

    I then tried to reverse the detection, asking if the platform was overlapping the player instead but that didn't work either. I then tried adding an additional criteria that one of the players detectors that is not used in normal collision is overlapping the moving platform, but that resulted in the overlap-condition overriding everything and ignoring the positioning conditions. Why would it do this? Any ideas how to work with this?

  2. #42
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Seems like there's a problem with the attachment, was it the .mfa?
    Can you try reupload?

    From what you describe it's very likely a scoping issue, as you say!

  3. #43
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I added an image of what the code looks like ,should be visible now!
    Any idea of how I get around the object scoping?

    I'm mostly perplexed of why it completely ignores the X,Y conditions when I add another selector condition.

  4. #44
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    If my eyes don't bug me you're checking against a qualifier,
    so I suppose you have multiple of (qualifier) object
    and they are in "side B" of comparison

    that won't work unless you put those conditions inside a "foreach" loop for the qualifier

    this alone could not be the solution, but it's hard to tell just from that image,
    if you need further help it would be very useful if you could isolate the not-working code in a new mfa to upload here

  5. #45
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the answer schrodinger! I tried changing the qualifier reference to checking towards the object itself, but that did not solve the problem either. Do I have to put direct object references inside a foreach loop as well?

  6. #46
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    yes, if you have multiple of those objects

    if you have a comparison:

    alt.val.X (player) < (object) right edge
    etc.

    and you have multiple "object"
    but you need to specifically check each single object (as in this case for all four boundaries)

    you need to specifically scope second term of comparison
    by filtering a single "object" (which you don't need to do)
    or, with a foreach, by "cyclically" filtering each single "object" (this is what you need to do)

    as a quick test, you can simply try

    always >>>
    start loop foreach (qualifier)

    and put:
    on each (qualifier)

    on top of your collision testing conditions above

    but again, no warranty this alone would work
    at least not without clearly seeing all the code involved

  7. #47
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, I tried scoping using a forEach loop and a regular loop but it did not work. I'll try and make an mfa example and upload it.

  8. #48
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ExamplewithCollisions.mfa

    Here, I added an example of the issue! You can click on a red square to delete it, and you'll notice that the collision then works.

    Somehow, if I remove the Y axis comparison it also works. I do not know why this is. Any ideas?

  9. #49
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Apr 2012
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Note: If I have several objects that share the same qualifier but are not the same object, it works. If there are more than one of the same object in the qualifier group, it does not work.

  10. #50
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Back again - here's a modified version:

    ExamplewithCollisions_1.mfa

    now you should just need to add vertical movement / vertical collision

    Btw, there's a slightly subtle issue when moving elements by integer vs floating point amounts,
    since the platform was moving with trig code, it could have moved by some "float" amount
    while the player is constantly moving at "integer" 1 pixel steps
    this results in some inconsistencies you could solve in (at least) two ways:
    1) checking all boundaries as float amounts (by storing all edges floatpositions, or object center floatposition +/- halfwidth/halfheight of both platform and player)
    with this you'll get high precision you can't take advantage of coordinate checks and Xright/Xleft (integer)
    2) in the file I went with this one because it's the first I thought of , trimming the X movement of both platform and player (which already was) to just integer movements

    if you don't do this, you get small overlaps/jaggyness due to rounding from two different positions

    Not sure I phrased it well enough to be clear,
    anyway, if you have other issues, let us know

Page 5 of 6 FirstFirst ... 3 4 5 6 LastLast

Similar Threads

  1. Replies: 6
    Last Post: 2nd June 2015, 11:21 AM
  2. Horizontal Moving Platform using Platform Movement Object example
    By Warmachine in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 20th January 2015, 09:31 PM
  3. 2 Platform Movements overlapping on a moving platform
    By SuperDisk in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 1st July 2013, 11:20 PM
  4. Moving Platform in Platform Movement Object
    By radel999 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th July 2012, 01:49 PM
  5. Horizontal moving platform
    By K1kk0z90 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 23rd January 2011, 05:47 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
  •