Is there an action that sends an event when an object stops moving - playmaker

So I have an enemy who randomly chooses between 4 destinations and I want him to play his idle animation when he stops moving, is there anyway this can be achieved.

Related

How to detect multiple mobile inputs at the same time with Godot?

In the game I am currently making, the player will frequently need to press two buttons at the same time, for example "jump" and "left". Currently I have two buttons on the left side of the screen for left and right, and one on the right for jump. The problem is, if the player is pressing any of them, it effectively locks the other buttons, making it so you can't press them.
Is there some way, perhaps using InputEventScreenTouch, that I can detect the user's current touchscreen input every frame, and check if they are pressing one or more buttons?
Edit for more info:
Currently each button sends it's button_down() and button_up() signals to the same function in the HUD scene root, and I have simple functions to handle that:
func setLeft(val):
# This is the variable that the player
# checks each frame to see if it should move
self.get_parent().get_parent().goingLeft = val
So when the player starts pressing the left button, it sets goingLeft to true, and when they release it it sets goingLeft to false.
This should work fine, but I have discovered that if the player is touching the screen anywhere else, the buttons don't register input. For example, if I press the left button, the player starts going left, and then while I am holding that, I start pressing jump. The jump button doesn't register, because my finger is already pressing somewhere else on the screen (the left one).
It doesn't seem to matter if it is a button that I am pressing, just that Godot will only check buttons if there is exactly one input.
Is there some way to get around this?
I have found the solution, thanks to some people in the comments!
I changed the button types to TouchScreenButton nodes, and they have multitouch enabled, so I can press more than one at once, on a mobile device!

SDL2 - show overlay on mouse motion and hide it some time after mouse stopped

As the title says I'm trying to accomplish an overlay menu in my SDL2 application.
I have a window where I want to show an overlay menu if the mouse starts moving and show it as long the mouse moves. If the mouse stops moving a timer should start with a specific timeout and should hide the menu after the timeout has passed.
I tried using mouse events like SDL_MOUSEMOTION, but that doesn't work. I would rather need something like "mouse motion stopped" events, where I then would start the timer.
I then thought I could combine SDL_MOUSEMOTION with SDL_GetRelativeMouseState() and compare the mouse position deltas and start the timer if the deltas are 0. But that kind of seems too complicated. Is the latter the way to go, or is there a simpler way?
There are several ways you could approach this:
SDL doesn't send 'mouse motion stopped' events but conceptually, a 'mouse motion stopped' event is a frame where you haven't received a mouse motion event. If you have a frame update loop, keep track of whether you've received a mouse motion event in the previous frame and update your menu timer accordingly.
Simply reset your menu's timer every time you receive a SDL_MouseMotion event. It's not elegant but it should work. Run the menu timer as soon as you receive the first motion event and just reset the timer each time you receive a subsequent one until it expires and you hide the menu.

make viewWillDisapear wait for animation to finish

So my issue is that in my viewWillDisapear I call a method that runs a animation (a bounce on the main view) but it doesn't wait for the animation to finish (since this runs in it's own thread). I need a way to make the execution stop till the uiAnimation is finished. i tried sleep() but for some reason this also pauses the actual animation.
What I realy need to happen is for the view to have a small bounce before it is slid of the screen. I am also open to any sugestions on how i can achieve this differently.

Silverlight - Play MediaElement at a time in a Storboard

I have a MediaElement that should be played at a certain point during a Storyboard (say 0.5 seconds in). Is it possible to kick off MediaElements at any particular point in a Storyboard? The Storyboard is set to repeat forever, so it should fire every time the marker reaches a certain time.

Silverlight MouseMove: find missing points during a movement

In an application in Silverlight I'm working on, I need to track the moves of the mouse. My problem is that using the MouseMove event, I don't have a continuous set of points if the user moves the mouse fast enough (if I add each point in a list I can have (10,10) en then (20,20)...)
I'd like to have ALL points where the mouse has been during the move.
Do you have any idea ?
This cannot work efficiently. The mousemove event of silverlight waits on the OS to send the signal with the coordinates to it. The operating system does not fire its event for every single point it moves, if it moves very fast. Most OS executes infinite loops, which checks for machine states, if these loops are fast, then it will probably pick up the mousemove for every point. If the mouse moves from (1,1) to (20,20) in 0.001ms, the OS will probably call the event at (10,10) or it will not at all if the loop does not hit it on time.
A way you can possibly speed this up is lessen the codes in your mousemove or make them async.
Another way is a mathematical way, to calculate the path based on what you have already collected.

Resources