How do I make sprite object move to waypoints? Also Question on UID.

0 favourites
  • 5 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hello,

    I am having a problem with Waypoints. Below is a picture of my 2 pink way points and blue AI enemy.

    I know how to move blue enemy square to a random on the layout or how to move it to the first

    pink square for example.

    However i cant seem to be able to move it to both pink waypoints one after another. Now i tried instance variable but that just adds the same instance variable to all the Waypoints. In events I cant see for example go to instance varable 1, then 2 etc. I know u do find path, then move along path etc under pathfinding conidtion.

    In the Moveto events there is move to object and pathfinding conditon both have direct and waypoint options, but dosnt go to all waypoints.

    Also i see that each sprite has a unique UID, how do you do them in events?. Would this be better for waypoints etc?.

    Thank You

    Tagged:

  • Not sure what the problem is. You can simply do this:

    For each WaypointSprite -> Character MoveTo WaypointSprite (add waypoint)

  • Thank you so much.

    I completely forgot about doing the system condition first that was why i couldn't do it. I need to learn to use system conditions and sub events more. As i was setting up scores and lives and they work now because i learned how to use sub events and global variables within system conditions.

    just like the the way points, the for each condition was in system settings and i never checked there or thought about it. Also i understand UIDs better, the lower the number e.g 5 the enemy AI will go to Waypoint UID 5 first then Waypoint UID 12 etc. I can make different paths which is great that is what i wanted. Sorry if i confused you.

  • Using UIDs is not always practical. You can add an instance variable PointID and use "For each Waypoint ordered by Waypoint.PointID" loop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I understand thank you.

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