User Tag List

Results 1 to 7 of 7

Thread: Only applying movement change only when overlapping object

  1. #1
    Clicker Fusion 2.5 (Steam)

    Join Date
    Sep 2018
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Only applying movement change only when overlapping object

    Hello, I'm working on a top-down shooter game, and I created an enemy which shoots at the player when it is overlapping an invisible square that follows the player, and I've been trying to make it so that when it's overlapping the square, it stops moving, but when the player moves away taking the square with it, the enemy starts moving again to get closer to the player and shoot it.

    The problem I have is that, yes, the enemy follows the player and stops moving and starts shooting when it overlaps the square, but when I move away, the enemy does not try to move, so the only way to get shot is getting close to it.

    If you know how to fix this, please tell me.

    Thank you!

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,159
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    Link the enemies movement to the players movement - so that if the player is moving, the enemy is also moving.

    something like

    if player speed > 10;
    set enemey speed = 10

  3. #3
    Clicker Fusion 2.5 (Steam)

    Join Date
    Sep 2018
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I want the enemies to always follow the player, but stay still and shoot ONLY when they are overlapping or touching the invisible object that follows the player.

    Now that I think about it, I think I might interchange this, instead of an invisiblke object following the player, I might make the object follow the enemies, so that when the player touches or overlaps the object, the enemy will stay still and shoot. I'll give it a try.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,159
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    What you're explaining there is somewhat impossible ...

    If an object is following the enemies and the enemies are following the player then unless they do a perfect loop around - they'll never meet.

  5. #5
    Clicker Fusion 2.5 (Steam)

    Join Date
    Sep 2018
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then I explained it badly.

    It's following as in always in the same position as the player or the enemy, it depends on who I put it on.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export Module
    Janette5's Avatar
    Join Date
    Dec 2014
    Location
    Western Cape, SA
    Posts
    1,159
    Mentioned
    199 Post(s)
    Tagged
    0 Thread(s)
    It would be better if you create a small .mfa with what you're trying to achieve and just point out where your event is failing - that's easier to fix than to try and recreate what you're doing from scratch.

    However, I've attached an example that might give you an idea.

    I've tied the trigger object and the enemy to the player's direction and speed. They're not moving independently, but being placed i.t.o. the player's position.
    However, because the enemy has less deceleration than the player and trigger object at any point if the player stops, then the enemy will run into the trigger object and shoot. But if the player never stops, the enemy will never overlap the trigger object.
    Attached files Attached files

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    679
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    always pin the square to the player. then do this:

    always
    --> set enemy flag follow ON

    enemy is overlapping square
    --> set enemy flag follow OFF

    enemy flag follow is ON
    --> chase player

Similar Threads

  1. Change Frame of an Object while overlapping
    By Joel in forum Fusion 2.5
    Replies: 2
    Last Post: 9th May 2015, 07:16 PM
  2. Applying force to physics platform movement
    By Keristero in forum Fusion 2.5
    Replies: 2
    Last Post: 27th March 2014, 07:39 AM
  3. Applying a shader only to an area overlapped / outlined by an object
    By fandelfinger in forum Hardware Accelerated Runtime
    Replies: 5
    Last Post: 1st January 2013, 10:22 AM
  4. A possible bug? With active object movement change
    By ionside in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 8th August 2011, 01:49 PM
  5. D&D movement object cannot change the Y position
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 17th January 2010, 06:07 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
  •