playMaker

Author Topic: Move towards, but only once  (Read 1085 times)

Mupp

  • Full Member
  • ***
  • Posts: 167
Move towards, but only once
« on: February 08, 2021, 03:24:47 PM »
I want to use an action that works like Move towards, but for some reason that one is a forced loop until its done. Why?
I only want to move an object towards a point a set distance once, and then move on to the next action. Not send an event.

Is there such an action? Couldn't find one on Eco.

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Move towards, but only once
« Reply #1 on: February 08, 2021, 11:19:13 PM »
What do you mean by "move on to the next action"?
like while moving towards, you do something else?


curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: Move towards, but only once
« Reply #2 on: February 09, 2021, 12:02:28 AM »
The 'send event' IS the next action. You can set up a series of Move Toward actions. eg:

Move Toward : Alien
Finish Distance : 100
Finish Event : spaceship....... Move Toward : Spaceship
                                           Finish Distance : 200
                                           Finish Event : planet....... Move Toward : Planet
                                                                                 Finish Distance : 100
                                                                                 Finish Event : die

etc etc etc etc

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Move towards, but only once
« Reply #3 on: February 09, 2021, 09:56:35 AM »
What I mean with next action, is the next action in the state. I have a state loop that does one cycle per frame and I want to move the object X units towards the target every time the state is entered.
This action loops automatically and does not leave the state until it's finished which is not what I want and I can't find an action that does this.

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Move towards, but only once
« Reply #4 on: February 09, 2021, 10:12:02 AM »
so you want to move the object x unit every cycle?
will this solve your problem?

1. Don't fill anything on the finish state, instead find an action call wait
2. say wait 0.5 sec and move it to the next state (State2), this will stop the movement and move on to State2.
3. here you can insert all action you wanted to do on each loop on state 2 
4. create an event and point it back to state 1 (The move forward)
5. let it loop back forth between state1 and state2

good luck

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Move towards, but only once
« Reply #5 on: February 09, 2021, 10:29:37 AM »
Thanks, but that won't work. I already have a wait in the cycle and also the distance the action move the object seems to be calculated over time which gives odd results and I need exact and consistent results.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: Move towards, but only once
« Reply #6 on: February 09, 2021, 11:15:21 AM »
How about using a combination of Look At, and Set Position (or Set Position Advanced).

On Set Position, on the appropriate axis (facing your destination via Look At) have a value of X (try a value of just 1 or 2 or larger for bigger incremental moves), and set the space to Self.

This will move the object by X, every time the action is called in the loop. 

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Move towards, but only once
« Reply #7 on: February 09, 2021, 01:52:08 PM »
Yes, close, minus the rotation. The object can't rotate. I need to get the direction between the object and a point, then move it a set distance along this line, and clamp the position so it doesn't move past the point.