Pathfinding refresh problem

0 favourites
  • 7 posts
From the Asset Store
For problem solving, puzzles, bubbles, platforms and other adventures.
  • Hello everybody!

    I've been searching all the evening to fix pathfnding on the game I want to create, I hope someone will be helpful because I'm stuck...

    well let me explain the problem simply:

    • I want an object to be created every "X" seconds and go from A to B (top to bottom), and add obstacles on mousclic / touch (on a tiled background, so the "floor" is a grid and my object moves from A to B on the center.

    The problem is when I refresh with:

    "System: Every Tick: MovingObject: Regenerate Pathfinding Obstacle Map"

    ... The obstacles I've put with "OnTouch" are only visible for newer moving objects, those who are already created don't see the obstacles, and they ignore newer obstacles... I've search all the afternoon/evening and could'nt find a solution (all I found was the " "System: Every Tick: MovingObject: Regenerate Pathfinding Obstacle Map" but it didn't fix the problem.

    here's my capx in MEGA: thanks in advance if anyone can help, it may be simple but I can't see what I'm missing

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • *moved to a more appropriate section.

  • Pathfinding can take more than a tick, so you can not use 'Every tick'. Use a longer time interval.

  • add pick all instances (moving object) before you regenerate map.

    also system:each tick is not needed if it's a top level event.

    also i'd recommend every 0.2sec instead of each tick. too cpu massive

  • blackhornet thansk!

    saiyadjin I think this can help but I cant figure out how to use pick all instance AND every 0.2 sec to regenerate them :/, I can either chose one or the other, but can't make an action every 0.2sec ... did I miss something ?

  • when you put an event:

    system - every 0.2 sec

    subevent: pick all instances of that object

    subevent: regen map for those objects (not sure if you can just use thatobject.regenerate map) or you have to loop through them with foreach (i'd say you can just call regen map since you've picked them all on screen)

    top events happen each tick. but when you put each 0.2 sec that particular event is skipped, and happens only each 0.2 sec

  • ... hmmm doesn't do the trick :/

    cry cry cry

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)