How to setup a sequence of movements by only clicking once?

Hi,
I am not getting a start on this at all. I got it working that an object is moving in a direction till it reaches a certain predefined location and then changes the direction and finally ends at anotther predefined location.

This all works fine by pointing at the object with the cursor and holding down left mouse button, it also works when I press the mouse button a million times.

But I would like to click the mouse button only once and then the object shall move according to the above descrition.

I´ve tried to put a loop node in between just for testing. But then it looks like a transformation and not a translation anymore. Can anybody provide a good setup for my problem.

This example is what you want to reach?

Example.blend (890.2 KB)

The logic is:

  1. you start to click over some object (that has rigid body);
  2. the location of this target object is stored in a variable;
  3. the suzanne location (object that will track) is stored also in a variable;
  4. when you release the mouse button, suzanne will go from its last location (stored in the moment you clicked) to the object location (also stored in the moment you clicked).

If you are trying to make some kind of path to the object follow, you can create an array of objects that are the “path” to track, then, you just need get the value of the array (the next object to follow) by its index:

When timer is Done (see the done output in timer node), you add +1 to the target id, using math add and set variable node:

If you still need some example on this i would provide when i have time :slight_smile:

1 Like

Thanks for the qick reply.
Maybe I can use the provided info for my project.
Looks like the timer will do the trick and it´s also nicer to set the location instead of using translate.
I think I was looking for is some kind of “relay” or permanent switch. But I´ve found somthing in the community which could be right.

In general my setup and the thing I want to achive is a little different.
Instead of clicking on one of the cubes I want to click on Suzanne and then she should move to cube A and after that to cube B…cube C…cube D…

Please have look at my node tree, feel free to give improvments or critics. The translation works but only when holding down the button.

Hi @JAWS81, I have a few questions about what you need.

  1. Should the Sussane a.) Move towards the specified locations (A, B, C…) at some rate or b.) Simply teleport to the location one after the other.

  2. Do the specified locations(A, B, C) change during the runtime(When the game is in progress). If these locations do not change, then you might use Blender’s animation system to animate the path for Sussane and then simply play during the run-time.

P.S. I assueme Sussane is the object you indent to move

Best Regards,
QC

2 Likes

Hi,

Suzanne, or in my case a machine part shall move in a specific rate, not teleporting, that was always happening in when i used loops.

the locations do not change and i am going to use preset values. I tried making an action in blender first. but then I ran into trouble as the part wasn’t executing the action when I had to make it a rigid body to make it selectable by mouse. Could also have been my lag of experience with armory causing this.

I have already implemented some of the things provided by knowledgenude, thanks again, and it seems to work. With minor errors, but i understood what is causing these.

1 Like

Great,

One more thing, when using animation on rigid bodies, the rigid body must be set to “Animated” in the blender RigidBody settings for it to work. Additionally, un-check the “Force Deactivation” so the animated rigid body does not sleep.

Best Reagrds,
QC

2 Likes