kellehk's Forum Posts

  • Try to remove the "dist <= 32" out of the function along with the variable.

    Do you see a green arrow near the function name? This means that this event has only occurred once it is called.

    In my understanding how the function can check if "dist <= 32" if it was called before?

    Sorry. I'm still trying to wrap my head around how the events flow.

    What I want to do is:

    -While the distance between dot and target is > 32

    ---move dot toward target.

    ---update distance variable.

    -(after exiting while loop) Set dot's position to target position.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi kellehk ,

    This is probably over simplified, but what about the pathfinding behavior ?

    On Dot spawned, make it pathfind to wherever you need to (even if thats a random cell, as you do have "cell" objects)

    On path found, move along path

    and that's it ?

    Here's what I tried:

    I don't know if I'm missing anything, but the dots don't move at all now.

  • Have you tried the variable "dist" in static?

    Just tried that now, didn't seem to fix the problem.

  • Hey guys. I'm really new to Construct 2 (Just started yesterday). I'm still getting the hang of the event system and the flow of things. I'm used to coding so this level of abstraction is a bit hard for me to get used to.

    I'm currently working on spawning objects at the top of the screen, having them drop down until they reach another object, and then stop.

    So far I have tried bullet behavior, custom movement, and the plain "set angle toward point" method to no avail.

    My current logic is setting a distance variable, moving the object toward the target, then when the object reaches a certain threshold (ie, < 32 pixel distance from the target), I set the object's position to the target point's coordinates.

    For some context, I have a 6x6 hex grid system where each cell has a cell object that I can reference.

    I'm working on spawning "Dot" objects from "spawn point" sprites, then the Dots fall into the first row of the grid.

    This is what my event sheet looks like:

    I know there's some sort of flow issue going on, I have the condition that checks if dist <= 32, but it doesn't seem to be checking for it.

    The Dots simply fall down forever and don't stop.