How To Check if Component is moving?

I want to see if a component of my Blueprint is currently moving. It is is, I want to play a sound. I have tried the following as well as other Velocity nodes but no joy…

Any help appreciated :slight_smile:

1 Like

Are you moving the components elsewhere, with a timeline etc?

Hi. Yes, the component is being moved via a MoveComponentTo node. It moves numerous times and I just want a sound to play each time it moves. Just a subtle sound. All works great except each movement will be a different length so I need to find out when it is moving to start the sound, then when it stops, I will stop the sound.

Hi. I’m using the MoveComponentTo node. But each movement will be a different length so I need to find out when it starts and ends its movements :slight_smile:

Ah… then you’ll need this on tick. Have you tried that?

well I’ve tried it on a Timer (at 0.01) but that doesn’t work. I’ll try Tick just incase for some reason it works and respond back here.

Nope. Tick doesn’t do it either :frowning:

  • create a Looping Sound Cue in the content browser

  • add an AudioComponent to the actor and assign the abovementioned Cue

  • scripted component:

It only keeps beeping while it moves.

Image from Gyazo

Hope I got that right! Good luck.

Although this is a great system and works in it’s own way, it doesn’t work for my system. It’s really difficult to explain why in text, but I really need to know when it starts to move and finishes. Also getting the speed would be great too as a bonus. There has got to be a way to do this in BP’s.
Also, thanks for the effort with your answer.

OK I got it! I found a node called ‘Get Physics Linear Velocity’ and this one is giving feedback of the velocity that I can use! Thanks to everyone for the responses.

I really need to know when it starts
to move and finishes

There’s logic behind that drives that, surely. Checking whether something happened every frame non-stop is a really bad idea and makes things unscalable and pretty much impossible to debug when things get complex. Not to mention the performance hit…


But again, the approach depends on the scope and end goal. So it might be fine. I did not see you mention (might have missed it) working with physics before. Perhaps you could look into how Wake / Sleep events work.

I know this is an old post now, but I’ve only now seen this reply. I wasn’t using physics, I was moving an object using the ‘move component to’ node. But ‘Get Physics Linear Velocity’ seemed to work regardless and so solved my issue. :+1: