How to add coroutine?

FlowCanvas Forums Support How to add coroutine?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #432
    rixter757
    Participant

    Hi Nav,

    Could you please help me implement a coroutine into this graph so that all objects have time to move?

    Thanks,

    Rix

    Attachments:
    You must be logged in to view attached files.
    #434
    Gavalakis
    Keymaster

    Hey,
    In the last version that is now on the asset store, the MoveTo node will get queued one after the other, so that all objects will move in order one after the other, so that there is no need of the coroutine node. Is that what you want? The objects to move one after the other?

    Also I spoted a small bug in the MoveTo node script. Here is a fix.
    Please open up Movement.cs script and replace the whole MoveTo class with the following new code:

    Please let me know if I understood something incorectly.
    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

    #437
    rixter757
    Participant

    Thanks Nav, yes that was exactly what I meant. I had tried my graph as per upload, but it moved only half of the objects so I had assumed I had something missing… which led me to think coroutine.

    Perhaps the bug fixes? I will try again with the fix and report back again.

    That said, it’s almost Easter so if I don’t catch you before you leave for the holidays, I hope you have some well-deserved time off 😉

    Rix

    #438
    rixter757
    Participant

    Ok Nuv,

    I have fixed the code, but now only one of my objects move.

    Does the graph in my first post look correct?

    I can confirm that the Tagify.FindGameObjects does indeed pick up the 11 objects I am seeking.

    Rix

    #439
    Gavalakis
    Keymaster

    Hey,
    Can you please confirm that you have the latest version from the asset store?
    Also thanks a lot for the holiday wishes. I hope you have a good time as well 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    #440
    rixter757
    Participant

    Yes, version 1.1 with Unity 5.3.4

    The Move To node even changes while running to display in the title that there are [11] objects.

    That’s why I wanted you to confirm my graph is correct, in case I am omitting something…

    R

    #441
    rixter757
    Participant

    Nuv,

    OK I see what’s happening here.

    The key is Stopping Distance. As a test I was attempting to move all objects to one fixed position. So the 1st got there, called the 2nd, then 1 & 2 fight to occupy the one space, and so neither could reach their destination… meaning the 3rd object couldn’t even start. Add in some stopping distance, they each move in turn.

    Now I need to understand another key here. You are using SetDestination instead of Move. SetDestination has to transition, whereas if you need to move something directly to target without animation, Move is needed. I thought maybe using SetDestination with a speed of 0 might be the same, but it doesn’t appear that way…

    #442
    rixter757
    Participant

    Confirmed. If I change the code from SetDestination to Move, all objects simply snap to location.

    I don’t know how you will want to handle this Nuv, your Move is really SetDestination Sequentially. Which is excellent!

    Maybe keep SetDestination in the code but have a condition that if Speed is zero, use Move instead… or it could equally add to your node count by adding another.

    I’m happy, I can manipulate to suit…

    #446
    Gavalakis
    Keymaster

    Hey,

    Thanks for letting me know. I though you originaly wanted to use pathfinding and not warp the agent to the target position.
    I’ve changed the node as you suggested so that if the speed is 0, it will warp the agent instead of set it’s destination.

    Thanks 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    #451
    rixter757
    Participant

    Excellent, thanks Nuv.

    I need both methods. Warp players into starting position, then transition from there…

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.