How do I move an object (water-enemy) to waypoints?

1 favourites
  • 6 posts
From the Asset Store
Water Sound consists of 85 seamless loops of water sounds and 5 Thunder sounds.
  • Hello! My students and I are working on Lesson 12 on the free teacher lessons 1-13. We are working on our last steps to complete the toaster maze. We have added the water enemy and are now trying to follow lesson 12 "Variable Naming Conventions".

    We have added waypoints that the water has to touch and labeled it 'waypointBlue', selected instance variable, and added variable names "ID" and "next ID" to it (initial value: 0). We have duplicated the waypoint and moved them all around our maze. We have changed the instance variable ID of each of waypointBlue sprites to the numbers 0,1,2 etc. in the order they should be visited by the water. We set each of the nextID variables to one more than the ID set for that instance. We have added an instance variable called targetID and left the initial value as 0.

    We are stuck on setting the bullet angle of motion to angle(water.X, water.Y, waypointBlue.X, waypointBlue.Y) degrees... see attached photo of the slide.

    When we try to type this in, it gives us a syntax error for the first comma (after Water.X)

    Can someone please assist us? We have been stuck on this for two days and have tried everything!!

    Thank you!

  • When we try to type this in, it gives us a syntax error for the first comma (after Water.X)

    Did you type the word angle( ?

    The expression is angle(water.X, water.Y, waypointBlue.X, waypointBlue.Y) , including the word "angle"

  • That worked! Kind of. Now its just going straight to the third way point and it just glitches out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Subscribe to Construct videos now

    Here's a video

    youtube.com/watch

  • You should probably follow those tutorial lessons. If you need the Water sprite to move from waypoint to waypoint, there should be more events. Once it reaches a waypoint, it should pick the next one and set it as its targetID. But I can't tell you for sure because I haven't seen those lessons.

    There is an easier way to do the same with MoveTo behavior:

    dropbox.com/scl/fi/312w1qp846z03urlpi1cg/Moveto_follow_path.c3p

  • Thank you! Yeah we have been following them, but they are sometimes not correct and we've had to work around them. This is all it says:

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